Skip to main content
Version: v1

charts()

This function is used to generate a chart of the top users in a guild.

Parameters​

ParameterTypeRequiredDescription
messageMessageβœ…The message object.
optionsChartOptions❌The options for the chart.

Returns <MessageAttachment>​

Image

Throws​

  • new Error() - if invalid parameters are provided, or if there are not enough users to create a chart.

[JS] Example​

const {charts} = require("simply-xp");

charts(message, options)
.then(console.log) // Returns the chart object
.catch((err) => console.log(err)); // Returns the error

Chart Options​

OptionsTypeRequiredDefaultDescription
positionNumber❌5Number of users needed to be in the chart
backgroundHex Code❌GREYBackground color of the chart
typeChart Type❌barAny one from these 'line' (or) 'bar' (or) 'radar' (or) 'doughnut' (or) 'polarArea