-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbot.py
38 lines (34 loc) · 981 Bytes
/
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
31
32
33
34
35
36
37
38
import os
import time
import discord
from discord.ext import commands
# from discord.ext.commands.core import command
from cogs.misc_ext import presence_change
from config import conf
TOKEN = conf().DISCORD_TOKEN
prefix = conf().PREFIX
print(f'prefix: {prefix}')
description = '''
Kiki Ripper.
it's a discord bot that has utility for scanlation.
'''
bot = commands.Bot(command_prefix=prefix, description=description)
@bot.event
async def on_ready():
print('Logged in as:')
print(bot.user.name)
print(bot.user.id)
print('-----------')
await presence_change(bot)
@bot.command()
async def ping(ctx:commands.Context):
'''Ping the bot if it online or not.'''
t1 = time.perf_counter()
await ctx.trigger_typing()
t2 = time.perf_counter()
await ctx.send(f'Pong! {round((t2-t1)*1000)} ms')
if __name__=='__main__':
cogs_to_load = ['cogs.cripper', 'cogs.merger']
for cog in cogs_to_load:
bot.load_extension(cog)
bot.run(TOKEN)