-
Notifications
You must be signed in to change notification settings - Fork 0
/
bot.py
50 lines (36 loc) · 1.38 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
from discord.ext import commands
import discord
import logging
import datetime
import config
import json
import asyncio
import subprocess
from multiprocessing import Pool
extensions = [
"cogs.nootcoin",
"cogs.admin"
]
class NootBot(commands.Bot):
async def load_extensions(self):
for extension in extensions:
await self.load_extension(extension)
def __init__(self):
intents = discord.Intents.default()
intents.members = True
intents.message_content = True
super().__init__(command_prefix='$', intents=intents)
self.logger = logging.getLogger('discord')
asyncio.get_event_loop().run_until_complete(self.load_extensions())
async def on_ready(self):
self.uptime = datetime.datetime.utcnow()
#game = discord.Game("Mining NootCoin")
#await self.change_presence(activity=game)
self.logger.warning(f'Online: {self.user} (ID: {self.user.id})')
async def on_message(self, message):
if message.author.bot:
return
if (message.channel.id == 642707799939481611 or message.channel.id == 514502736608231435 or message.channel.id == 1223664467670204428 or message.channel.id == 1224154388084555907):
await self.process_commands(message)
async def run(self):
await super().start(config.token, reconnect=True)