Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
discbot-factory
Advanced tools
A helper tool to create discord bots with discord.js.
Pre builded modules like queue and voice. Simple implementations ways.
// src/index.ts
import { Core } from "discbot-factory";
const bot: Core = new Core("<bot-name>", "<prefix>", {});
bot.authClient("<token>");
// src/commands/HelloWorldCommand.ts
import { ICommand, Command } from "discbot-factory";
export default class HelloWorldCommand implements ICommand {
public readonly name: string = "hello"; // execute with <prefix>hello "!hello"
public readonly description: string = "The hello world command";
public execute(command: Command): void {
const author: string = command.message.author.username;
command.message.channel.send(`Hello world, ${author}!`);
}
}
// src/index.ts
import { Core } from "discbot-factory";
import HelloWorldCommand from "./commands/HelloWorldCommand";
const bot: Core = new Core("<bot-name>", "<prefix>", {
commands: [new HelloWorldCommand()],
middlewares: [],
events: [],
});
bot.authClient("<token>");
A pre-builded voice module for create voice channel interactions.
import { Voice } from "discbot-factory";
const voice: Voice = new Voice("youtube"); // local or youtuber player.
async function playMusic(voiceChannel: VoiceChannel): Promise<void> {
await voice.connect(voiceChannel);
// if you are using local player, just pass the sound path.
await voice.play("https://www.youtube.com/watch?v=mH_z5vAkf2c");
voice.onEnd((): void => {
console.log("Finished!");
});
}
A queue module, nice to use with voice module and to create cool experiences like mini-games.
import { Queue } from "discbot-factory";
const queue: Queue<string> = new Queue<string>();
queue.putOnTop("hello");
queue.putOnBottom("oh no, I'm the last");
// get the first item
console.log(queue.get()) // hello
queue.removeHead();
console.log(queue.get()) // oh no, I'm the last
queue.clear();
console.log(queue.getAll()); // []
Equivalent to a client.on("event", callback)
implementation.
import { IEvent, PublicEvent } from "discbot-factory";
import { Message } from "discord.js";
export default class MessageDeleteEvent implements IEvent<Message, {}, {}> {
public readonly name: PublicEvent = PublicEvent.MESSAGE_DELETE;
public readonly description: string = "On message delete event";
public execute(message: Message): void {
console.log(message.content);
}
}
import IMiddleware from "../Core/IMiddleware";
import { Command } from "../Core/ICommand";
export default class AdminMiddleware implements IMiddleware {
constructor(public readonly forCommands: Array<string>) {}
public middle(command: Command): boolean {
const username: string = command.message.author.username;
if (username === "another dan") {
return true;
}
command.message.react("🚫");
return false;
}
}
FAQs
Discord chat bot pre-builded core.
The npm package discbot-factory receives a total of 1 weekly downloads. As such, discbot-factory popularity was classified as not popular.
We found that discbot-factory demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.