forked from Mindcool25/rcshsBot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
35 lines (25 loc) · 905 Bytes
/
main.py
File metadata and controls
35 lines (25 loc) · 905 Bytes
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
#IMPORTS
import discord
from discord.ext import commands
#NOT TO BE EDITED!
with open('token.txt') as f:
TOKEN = f.readline()
def get_prefix(bot, message):
# The prefix for bot commands
prefixes = ["."]
return commands.when_mentioned_or(*prefixes)(bot, message)
# If you make your own cog file, add it in a similar way that basic is added here, with 'cogs.<filename>'
extensions = ['cogs.basic', 'cogs.pl_dictionary']
bot = commands.Bot(
command_prefix=get_prefix, description='Bot for the r/CSHighschoolers discord server')
if __name__ == '__main__':
for extension in extensions:
print(f"Loading {extension}...")
bot.load_extension(extension)
print("Loaded extensions")
@bot.event
async def on_ready():
print(
f'\nLogged in as: {bot.user.name} - {bot.user.id}\nVersion: {discord.__version__}\n'
)
bot.run(TOKEN, bot=True, reconnect=True)