New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

utilityxtreme

Package Overview
Dependencies
Maintainers
1
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

utilityxtreme

The friendly package to start with your Discord bot application

unpublished
latest
Source
npmnpm
Version
1.5.1
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

UtilityXtreme

The friendly package to start with your Discord bot application.


UtilityXtreme is a library that simplifies of creating your own Discord bot application.

  • Easy to use & Beginner friendly.
  • 99.9% Promise based.
  • Supportable with latest discord.js version (v14).
  • Open-source project.
  • Feature-rich.
  • 100% written in TypeScript.

Table of Contents

  • UtilityXtreme

Requirements

Optional:

  • Use TypeScript instead of JavaScript for the typings.
  • Use an IDE with a powerful Intellisense (example: Visual Studio code) for the typings.

Installation

npm install utilityxtreme
yarn add utilityxtreme

Documentation

Warn: This package is focused on declaration files, any comments are not going to be defined in the documentation site.

Click here to visit the documentation website.

Modules preview

  • Modules
    • Classes
      • ApplicationCommandsLoader: Loads application commands to Discord.
      • BoostDetector: Detects whenever a guild member has boosted or has removed a boost from a guild.
      • ButtonsPaginatorBuilder: An advanced paginator using buttons.
      • Calculator: A simple and pre-ready calculator (mathjs not required).
      • FileBuilder: Creates a file for Discord, by using Buffer.
      • JSONDatabase: The methods are similar to Map but the data is saved in a JSON file.
      • StringSelectMenuPaginatorBuilder: An advanced paginator using dropdown/select menus.
    • Functions
      • calculateString: Calculates some simple math equations.
      • censorString: Replaces some characters in a string with '*' (changeable).
      • createDiscordTimestamp: Creates a Discord timestamp.
      • hexColorGen: Generates a random HEX color code.
      • idGen: Generates a random integer.
      • isDiscordInviteURL: Detects whenever a string includes a Discord invite URL.
      • isWebURL: Detects whenever a string includes any web URL.
      • randomizedString: Generates some random characters.
      • reverseString: Reverses a string.
      • async sleep: Sleeps for a specific time.

Example Discord Bot

TypeScript:

import { Client, SlashCommandBuilder } from 'discord.js';
import { ApplicationCommandsLoader } from 'utilityxtreme';

const botToken = "Your bot token";
const botId = "Your bot id";

const client: Client = new Client({
    intents: ['Guilds']
});

const commands: SlashCommandBuilder[] = [
    new SlashCommandBuilder()
        .setName('ping')
        .setDescription('Replies with Pong!')
];

const loader: ApplicationCommandsLoader = new ApplicationCommandsLoader(botToken, botId, commands);

loader.on('loaderStarted', () => { console.log('Started loading application commands...') });
loader.on('loaderFinished', () => { console.log('Finished loading application commands.') });

loader.start().catch(console.error);

client.on('interactionCreate', async (interaction) => {
    if (!interaction.isChatInputCommand()) return;

    if (interaction.commandName === 'ping') {
        await interaction.reply({ content: 'Pong!' });
    };
});

client.login(botToken);

JavaScript: (CommonJS)

const { Client, SlashCommandBuilder } = require('discord.js');
const { ApplicationCommandsLoader } = require('utilityxtreme');

const botToken = "Your bot token";
const botId = "Your bot id";

const client = new Client({
    intents: ['Guilds']
});

const commands = [
    new SlashCommandBuilder()
        .setName('ping')
        .setDescription('Replies with Pong!')
];

const loader = new ApplicationCommandsLoader(botToken, botId, commands);

loader.on('loaderStarted', () => { console.log('Started loading application commands...') });
loader.on('loaderFinished', () => { console.log('Finished loading application commands.') });

loader.start().catch(console.error);

client.on('interactionCreate', async (interaction) => {
    if (!interaction.isChatInputCommand()) return;

    if (interaction.commandName === 'ping') {
        await interaction.reply({ content: 'Pong!' });
    };
});

client.login(botToken);

Developers

Support

Did you find a problem (or a bug), or want to share some new ideas? Join the Discord server below!

You can create an Issue or a Pull Request instead on GitHub.

Other information

License:

This project is under the license GPL-3.0.

Development:

This package is not associated with the discord.js development team.

↑ Back to top

Keywords

discord

FAQs

Package last updated on 15 May 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts