🎟️
Champion Tickets
DiscordBuiltByBit
  • Tebex Themes Docs
  • Champion Ultra 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.7.6 Migration
      • Change DB Type
      • Mongo Database
      • database-actions addon
  • Configuration
    • config.yml
    • categories.yml
    • commands.yml
    • language.yml
    • embeds.yml
    • products.yml
  • Addons
    • Example Addon
    • Creating Addons
    • Selling Addons
  • Other
    • Basic Server Configuration
    • SelfHost Transcripts
    • Dashboard Setup
    • Errors
    • PayPal (Invoices)
    • Tebex & Sellix
    • Update v1.7.8
Powered by GitBook
On this page

Was this helpful?

  1. Addons

Example Addon

Example Addon for Champion Tickets Discord Bot.

Previousproducts.ymlNextCreating 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")
		}
	});
}