@aminedev07/distortion

0.1.1 • Public • Published

Distortion

A basic framework for guilded bots using touchguilded, for educational purposes

Usage:

main.ts

import { GuildedClient, ClientConstructorOptions } from '../lib/Client';

const settings: ClientConstructorOptions = {
  token: 'Token_here',
  prefix: '!' // or any prefix of your choice,
  eventFolderPath: '../src/events' // or any dir of your choice default is /events/,
  commandFolderPath: '../src/commands' // or any dir of your choice default is /commands/,
};

const client = new GuildedClient(settings);

client.start();

/commands/example.ts

import { Command } from '../../lib/Command';
import { GuildedClient } from '../../lib/Client';
import { Message, TextChannel } from 'touchguild';

export default class TestCommand implements Command {
  name = 'test';

  run(client: GuildedClient, message: Message<TextChannel>, args: string[]): void {
    message.channel.createMessage({content:`testing`});
  }
}

/events/example.ts

import { Event } from '../../lib/Event';
import { GuildedClient } from '../../lib/Client';
import { CommandsRegistry } from '../../lib/CommandsRegistry';
import { Message, TextChannel } from 'touchguild';

export default class TestEvent implements Event {
  name = 'test';

  async run(client: GuildedClient, message: Message<TextChannel>): Promise<void> {
    console.log("Testing")
  }
}
/* That's not a working event listener it's just a template */

Package Sidebar

Install

npm i @aminedev07/distortion

Weekly Downloads

1

Version

0.1.1

License

Apache-2.0

Unpacked Size

20.9 kB

Total Files

15

Last publish

Collaborators

  • aminedev07