UNPKG

@getsolara/solara.js

Version:

A lightweight and modular Discord bot framework built on discord.js v14, with truly optional feature packages.

11 lines 414 B
module.exports = { name: "$round", description: "Rounds a number to the nearest integer.", takesBrackets: true, execute: async (context, args) => { if (!args[0]) return "[Error: $round requires a number]"; const num = parseFloat(args[0]); if (isNaN(num)) return `[Error: Invalid number "${args[0]}" for $round]`; return Math.round(num).toString(); } };