aboutsummaryrefslogtreecommitdiff
path: root/bot.py
diff options
context:
space:
mode:
authorAnInternetTroll <lucafulger@gmail.com>2020-05-10 10:57:29 +0000
committerAnInternetTroll <lucafulger@gmail.com>2020-05-10 10:57:29 +0000
commite56aee64210ebcb2603d1497bdc577670b7e0ed7 (patch)
tree2b31498d672aab1a86231abf02d981c7cd454496 /bot.py
parent7f15747e7689b9bc58105cc909f0d8b95081fbd9 (diff)
downloadsteve-bot-e56aee64210ebcb2603d1497bdc577670b7e0ed7.tar
steve-bot-e56aee64210ebcb2603d1497bdc577670b7e0ed7.tar.gz
steve-bot-e56aee64210ebcb2603d1497bdc577670b7e0ed7.tar.bz2
steve-bot-e56aee64210ebcb2603d1497bdc577670b7e0ed7.tar.lz
steve-bot-e56aee64210ebcb2603d1497bdc577670b7e0ed7.tar.xz
steve-bot-e56aee64210ebcb2603d1497bdc577670b7e0ed7.tar.zst
steve-bot-e56aee64210ebcb2603d1497bdc577670b7e0ed7.zip
General improvements
Diffstat (limited to 'bot.py')
-rwxr-xr-xbot.py67
1 files changed, 34 insertions, 33 deletions
diff --git a/bot.py b/bot.py
index cace1d1..179ca08 100755
--- a/bot.py
+++ b/bot.py
@@ -7,52 +7,53 @@ import config
import json
extensions = [
- "cogs.utils",
- "cogs.admin"
+ "cogs.utils",
+ "cogs.admin"
]
class BedrockBot(commands.Bot):
- def __init__(self):
- super().__init__(command_prefix='/')
- self.logger = logging.getLogger('discord')
+ 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)
+ with open('custom_commands.json', 'r') as f:
+ self.custom_commands = json.load(f)
- for extension in extensions:
- self.load_extension(extension)
-
-
+ for extension in extensions:
+ self.load_extension(extension)
+
+
- async def on_ready(self):
- self.uptime = datetime.datetime.utcnow()
+ async def on_ready(self):
+ self.uptime = datetime.datetime.utcnow()
- game = discord.Game("Mining away")
- await self.change_presence(activity=game)
+ game = discord.Game("Mining away")
+ await self.change_presence(activity=game)
- self.logger.warning(f'Online: {self.user} (ID: {self.user.id})')
+ self.logger.warning(f'Online: {self.user} (ID: {self.user.id})')
- async def on_message(self, message):
+ async def on_message(self, message):
- if message.author.bot:
- return
+ if message.author.bot:
+ return
- command = message.content.split()[0]
+ command = message.content.split()[0]
- if command in self.custom_commands:
- await message.channel.send(self.custom_commands[command])
- return
+ 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:
- count = 0
- for word in badWords:
- if word in message.content.lower():
- count += 1;
- await message.channel.send('Fair '*count)
+ badWords = ["fair", "f a i r", "ⓕⓐⓘⓡ", "ⓕ ⓐ ⓘ ⓡ"]
+ if message.channel.id == 589110766578434078:
+ count = 0
+ for word in badWords:
+ if word in message.content.lower():
+ count += 1;
+ fair = 'Fair '*count
+ await message.channel.send(fair)
- await self.process_commands(message)
+ await self.process_commands(message)
- def run(self):
- super().run(config.token, reconnect=True)
+ def run(self):
+ super().run(config.token, reconnect=True)