diff options
author | AnInternetTroll <lucafulger@gmail.com> | 2020-05-10 20:48:08 +0000 |
---|---|---|
committer | AnInternetTroll <lucafulger@gmail.com> | 2020-05-10 20:48:08 +0000 |
commit | efa99965c4390bca433999c6ff5c188a84b2dbe5 (patch) | |
tree | 8dfe219692ab161ba7bde9770e6932cd466cc9c0 | |
parent | e56aee64210ebcb2603d1497bdc577670b7e0ed7 (diff) | |
download | steve-bot-efa99965c4390bca433999c6ff5c188a84b2dbe5.tar steve-bot-efa99965c4390bca433999c6ff5c188a84b2dbe5.tar.gz steve-bot-efa99965c4390bca433999c6ff5c188a84b2dbe5.tar.bz2 steve-bot-efa99965c4390bca433999c6ff5c188a84b2dbe5.tar.lz steve-bot-efa99965c4390bca433999c6ff5c188a84b2dbe5.tar.xz steve-bot-efa99965c4390bca433999c6ff5c188a84b2dbe5.tar.zst steve-bot-efa99965c4390bca433999c6ff5c188a84b2dbe5.zip |
Added findseed command and the ! prefix
-rwxr-xr-x | bot.py | 27 | ||||
-rwxr-xr-x | cogs/utils.py | 12 | ||||
-rwxr-xr-x | custom_commands.json | 9 |
3 files changed, 28 insertions, 20 deletions
@@ -14,7 +14,7 @@ extensions = [ class BedrockBot(commands.Bot): def __init__(self): - super().__init__(command_prefix='/') + super().__init__(command_prefix=('/', '!')) self.logger = logging.getLogger('discord') with open('custom_commands.json', 'r') as f: @@ -38,22 +38,25 @@ 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") + 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: - 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) - def run(self): super().run(config.token, reconnect=True) diff --git a/cogs/utils.py b/cogs/utils.py index 9959fdb..cd883f8 100755 --- a/cogs/utils.py +++ b/cogs/utils.py @@ -8,6 +8,7 @@ import asyncio from datetime import timedelta from google.cloud import translate_v2 as translate translate_client = translate.Client() +import random async def translateMsg(text, target="en"): # Text can also be a sequence of strings, in which case this method @@ -143,5 +144,16 @@ class Utils(commands.Cog): await ctx.message.delete() await verifyRole(self, ctx, apiKey) + @commands.command() + async def findseed(self, ctx): + totalEyes = 0 + for i in range(12): + randomness = random.randint(1,10) + if randomness == 1: + totalEyes += randomness + else: + continue + await ctx.send(f"{ctx.message.author.name} -> your seed is a {totalEyes} eye") + def setup(bot): bot.add_cog(Utils(bot)) diff --git a/custom_commands.json b/custom_commands.json index e9d18d7..db953e3 100755 --- a/custom_commands.json +++ b/custom_commands.json @@ -1,8 +1 @@ -{ - "/src": "https://www.speedrun.com/mcbe", - "/launcher": "https://github.com/MCMrARM/mc-w10-version-launcher/releases/tag/0.1.0", - "/locate": "head north", - "/boards": "https://www.speedrun.com/mcbe", - "/leaderboards": "https://www.speedrun.com/mcbe", - "/ban": "shut up" -}
\ No newline at end of file +{"/src": "https://www.speedrun.com/mcbe", "/launcher": "https://github.com/MCMrARM/mc-w10-version-launcher/releases/tag/0.1.0", "/locate": "head north", "/boards": "https://www.speedrun.com/mcbe", "/leaderboards": "https://www.speedrun.com/mcbe", "/ban": "shut up", "/ssg": "https://www.speedrun.com/mcbe#Any_Glitchless"}
\ No newline at end of file |