-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
34 lines (27 loc) · 1.03 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
import discord
import time
from modules import tools
intents = discord.Intents.default()
intents.message_content = True
bot = discord.Bot(intents=intents)
cogs = ['overwatch']
@bot.event
async def on_ready():
print(" ")
tools.console("Bot online!")
tools.console(f"Username: {str(bot.user)}")
tools.console(f"Currently in {len(bot.guilds)} guilds")
print(" ")
@bot.slash_command(name = 'ping', description = "Check the bot's response time.")
async def ping(ctx):
latency = round(bot.latency*1000)
e = tools.embed(bot, title="🏓 Pong!", desc=f"This took me {latency}ms.")
await ctx.respond(embed=e)
@bot.slash_command(name = 'invite', description = "Generate an invite link.")
async def invite(ctx):
url = discord.utils.oauth_url(client_id=bot.user.id, permissions=discord.Permissions.advanced())
e = tools.embed(bot, title="📨 Invite Link", desc=f"You can invite me using [this link]({url}).")
await ctx.respond(embed=e)
for cog in cogs:
bot.load_extension(f'cogs.{cog}')
bot.run(tools.token())