-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbot.py
More file actions
48 lines (40 loc) · 1.25 KB
/
Copy pathbot.py
File metadata and controls
48 lines (40 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
""""
Ignite Discord Bot
Original by VanDerFire
MIT License
(C)2021-2022
"""
import discord
import os
import json
from discord.ext import commands
#Open config.json
if os.path.isfile("config.json"):
with open("config.json") as file:
data = json.load(file)
#load the token
token = data["token"]
prefix = data["prefix"]
print("config.json loaded")
else:
print("config.json does not exist. Create the file and try again.")
#Bot Configuration
bot = commands.Bot(command_prefix=prefix, activity = discord.Game(name='FlameEngine Azure'))
#Bot Events
@bot.event
async def on_ready():
print('Ignite Discord Bot')
print('(C)2021-2022 VanDerFire')
print('Under MIT License.')
print("About the bot:")
print(f"Username: {bot.user.name}")
print(f"Bot ID: {bot.user.id}")
#Bot Commands
#Example command
@bot.slash_command(guild_ids=[...]) #Put here the IDs of the servers where you want the bot to run, this can be omitted, but keep in mind that new commands may take up to an hour to be registered (This applies to all slash-type commands, including cogs)
async def say(ctx, message):
await ctx.respond(message)
bot.load_extension('cogs.Moderation')
bot.load_extension('cogs.Interaction')
#Run the bot
bot.run(token)