aboutsummaryrefslogtreecommitdiff
path: root/bot.py
diff options
context:
space:
mode:
authorAnInternetTroll <lucafulger@gmail.com>2020-05-12 21:07:26 +0000
committerAnInternetTroll <lucafulger@gmail.com>2020-05-12 21:07:26 +0000
commitc59e677819055e5322898063332368b575088552 (patch)
treed0ef240a5beff246e18294cf1b42c1fb7f29cf74 /bot.py
parentefa99965c4390bca433999c6ff5c188a84b2dbe5 (diff)
downloadsteve-bot-c59e677819055e5322898063332368b575088552.tar
steve-bot-c59e677819055e5322898063332368b575088552.tar.gz
steve-bot-c59e677819055e5322898063332368b575088552.tar.bz2
steve-bot-c59e677819055e5322898063332368b575088552.tar.lz
steve-bot-c59e677819055e5322898063332368b575088552.tar.xz
steve-bot-c59e677819055e5322898063332368b575088552.tar.zst
steve-bot-c59e677819055e5322898063332368b575088552.zip
Cleanup
Diffstat (limited to 'bot.py')
-rwxr-xr-xbot.py35
1 files changed, 17 insertions, 18 deletions
diff --git a/bot.py b/bot.py
index e8c6152..80a3787 100755
--- a/bot.py
+++ b/bot.py
@@ -8,13 +8,27 @@ import json
extensions = [
"cogs.utils",
- "cogs.admin"
+ "cogs.admin",
+ "cogs.src",
+ "cogs.help"
]
+def get_prefix(bot, message):
+ """A callable Prefix for our bot. This could be edited to allow per server prefixes."""
+
+ prefixes = ['/', '!', 'steve ']
+
+ # Check to see if we are outside of a guild. e.g DM's etc.
+ #if not message.guild:
+ # Only allow ? to be used in DMs
+ # return '?'
+
+ # If we are in a guild, we allow for the user to mention us or use any of the prefixes in our list.
+ return commands.when_mentioned_or(*prefixes)(bot, message)
class BedrockBot(commands.Bot):
def __init__(self):
- super().__init__(command_prefix=('/', '!'))
+ super().__init__(command_prefix=get_prefix)
self.logger = logging.getLogger('discord')
with open('custom_commands.json', 'r') as f:
@@ -22,8 +36,6 @@ class BedrockBot(commands.Bot):
for extension in extensions:
self.load_extension(extension)
-
-
async def on_ready(self):
self.uptime = datetime.datetime.utcnow()
@@ -37,20 +49,7 @@ class BedrockBot(commands.Bot):
if message.author.bot:
return
-
- badWords = ["fair", "f a i r", "ⓕⓐⓘⓡ", "ⓕ ⓐ ⓘ ⓡ"]
- try:
- 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)
- except:
- print("shrug")
+ await self.process_commands(message)
command = message.content.split()[0]