diff options
author | AnInternetTroll <lucafulger@gmail.com> | 2020-05-06 10:00:46 +0000 |
---|---|---|
committer | AnInternetTroll <lucafulger@gmail.com> | 2020-05-06 10:00:46 +0000 |
commit | 14fd81118a30dea394eca940cefb6dda86b66933 (patch) | |
tree | 5105b1cf1d0ef86dd651e17564c49f58c384b3ed /bot.py | |
download | steve-bot-14fd81118a30dea394eca940cefb6dda86b66933.tar steve-bot-14fd81118a30dea394eca940cefb6dda86b66933.tar.gz steve-bot-14fd81118a30dea394eca940cefb6dda86b66933.tar.bz2 steve-bot-14fd81118a30dea394eca940cefb6dda86b66933.tar.lz steve-bot-14fd81118a30dea394eca940cefb6dda86b66933.tar.xz steve-bot-14fd81118a30dea394eca940cefb6dda86b66933.tar.zst steve-bot-14fd81118a30dea394eca940cefb6dda86b66933.zip |
First commit :partying_face:
Diffstat (limited to 'bot.py')
-rwxr-xr-x | bot.py | 56 |
1 files changed, 56 insertions, 0 deletions
@@ -0,0 +1,56 @@ +from discord.ext import commands +import discord +import logging + +import datetime +import config +import json + +extensions = [ + "cogs.utils", + "cogs.admin" +] + +class CelesteBot(commands.Bot): + + def __init__(self): + super().__init__(command_prefix='/') + self.logger = logging.getLogger('discord') + + with open('custom_commands.json', 'r') as f: + self.custom_commands = json.load(f) + + for extension in extensions: + self.load_extension(extension) + + + + async def on_ready(self): + self.uptime = datetime.datetime.utcnow() + + game = discord.Game("Mining away") + 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 + + command = message.content.split()[0] + + if command in self.custom_commands: + await message.channel.send(self.custom_commands[command]) + return + + badWords = ["fair", "f a i r", "ⓕⓐⓘⓡ", "ⓕ ⓐ ⓘ ⓡ"] + if message.channel.id == 589110766578434078: + for word in badWords: + if word in message.content.lower(): + await message.channel.send('Fair') + + await self.process_commands(message) + + def run(self): + super().run(config.token, reconnect=True) |