-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbot.py
30 lines (29 loc) · 1.06 KB
/
bot.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
import os
import discord
from discord.ext import commands
from dotenv import load_dotenv
intents = discord.Intents.default()
intents.members = True
load_dotenv()
token = os.getenv('DISCORD_TOKEN')
client = commands.Bot(command_prefix='s!',intents=intents)
@client.event
async def on_ready():
print("Sentient Medbay Scanner is analysing. Hello.")
await client.change_presence(
status=discord.Status.online, activity=discord.Game("Among Us")
)
@client.event
async def on_command_error(ctx, error):
if isinstance(error, commands.errors.MissingRequiredArgument):
await ctx.send("Please give all the arguments.")
elif isinstance(error, commands.errors.BadArgument):
await ctx.send("Conversion of arguments failed.")
elif isinstance(error,commands.errors.CommandNotFound):
await ctx.send("Command not found.")
elif isinstance(error, commands.errors.NotOwner):
await ctx.send("You ain't the bot owner!")
print(f"ERROR: {error}")
client.load_extension("cogs.main")
client.load_extension("cogs.admin")
client.run(token)