forked from nuke886/rcshsBot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
43 lines (35 loc) · 1.57 KB
/
main.py
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
#IMPORTS
import nextcord
import botPrefixes as bp
from nextcord.ext import commands
#NOT TO BE EDITED!
with open("token.txt") as f:
TOKEN = f.readline()
def get_prefix(bot, message):
return commands.when_mentioned_or(*bp.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.music", "cogs.moderation.prefix_control"]
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():
for guild in bot.guilds:
for channel in guild.text_channels:
if str(channel) == "🌎-general" or str(channel) == "𝕋𝕒𝕝𝕜𝕤":
Embed = nextcord.Embed()
Embed.set_image(url="https://c.tenor.com/Fi1DbctJXQQAAAAC/what-what-up.gif")
await channel.send(embed=Embed)
print(f"Active in {guild.name}\n Member Count : {guild.member_count}")
# This will handle events but if you dont handle every single error you can get, some might slip by without you knowing.
# For more info watch (https://youtu.be/_2ifplRzQtM?list=PLW3GfRiBCHOhfVoiDZpSz8SM_HybXRPzZ)
#
# @bot.event
# async def on_command_error(ctx, error):
# if isinstance(error, commands.MissingRequiredArgument):
# await ctx.reply("Please pass in all required arguments.")
bot.run(TOKEN, reconnect=True)