💾
Champion Ultra
DiscordBuiltByBit
  • Tebex Themes Docs
  • Champion Tickets Docs
  • Champion Ptero Docs
  • Welcome
    • Introduction
    • Commands
      • Permissions
    • Features
    • Images
  • Installation & Setup
    • Newbie Guide
    • Requirements
    • Bot Application Setup
    • Linux Installation
    • Invite Link
    • Pterodactyl
    • Database
      • v1.2.8 Migration
      • Change DB Type
      • Mongo Database
      • database-actions addon
  • Configuration
    • config.yml
    • commands.yml
    • applications.yml
    • language.yml
    • embeds.yml
  • Advanced Ticketing
    • Introduction
    • Installation
  • Addons
    • Example Addon
    • Creating Addons
    • Selling Addons
  • Other
    • Basic Server Configuration
    • Dashboard Setup
    • Errors
Powered by GitBook
On this page

Was this helpful?

  1. Addons

Example Addon

Example Addon for Champion Ultra Discord Bot.

PreviousInstallationNextCreating Addons

Last updated 2 years ago

Was this helpful?

Bot is provided with one (1) addon by default. It's used to show how to create addons and to explain which field does what.

Addon Folder Structure

Example Addon File

const { set: setCommand } = require("../../handlers/commands");
const { set: setEvent } = require("../../handlers/events");
const fs = require("fs");
const yaml = require("js-yaml");
// Load Addon's Configuration, 'example' = addon name
const config = yaml.load(fs.readFileSync('./addons/example/addon_config.yml', 'utf8'));
 
module.exports.run = (client) => {
	setCommand(client, {
		name: "example",
		description: "Example Description",
		usage: "Example Usage",
		permissions: [],
		aliases: [],
		category: "addon",
		listed: false,
		slash: true,
		async run(message, args) {
			message.channel.send({ content: "Example Addon - Normal Command." })
		},
		async slashRun(interaction, args) {
			interaction.reply({ content: "Example Addon - Slash Command." })
		} 
	});

	setEvent(client, {
		name: 'ready',
		async run() {
			console.log("Example Addon - ready Event")
		}
	});
}