aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnInternetTroll <lucafulger@gmail.com>2020-07-04 15:52:20 +0000
committerAnInternetTroll <lucafulger@gmail.com>2020-07-04 15:52:20 +0000
commit55cef1c7b6c6f4703eedae29965f5b1df5573a56 (patch)
tree4682a9942d17ac6160aeac9fc1add9be16cb04b2
parente593aa26927db20ce21b7dcf6ec499dad232f01d (diff)
downloadsteve-bot-55cef1c7b6c6f4703eedae29965f5b1df5573a56.tar
steve-bot-55cef1c7b6c6f4703eedae29965f5b1df5573a56.tar.gz
steve-bot-55cef1c7b6c6f4703eedae29965f5b1df5573a56.tar.bz2
steve-bot-55cef1c7b6c6f4703eedae29965f5b1df5573a56.tar.lz
steve-bot-55cef1c7b6c6f4703eedae29965f5b1df5573a56.tar.xz
steve-bot-55cef1c7b6c6f4703eedae29965f5b1df5573a56.tar.zst
steve-bot-55cef1c7b6c6f4703eedae29965f5b1df5573a56.zip
Command descriptions added
-rwxr-xr-xbot.py4
-rwxr-xr-x[-rw-r--r--]cogs/admin.py26
-rwxr-xr-xcogs/compiler.py79
-rwxr-xr-xcogs/general.py466
-rwxr-xr-xcogs/help.py395
-rwxr-xr-xcogs/trans.py2
-rwxr-xr-xcogs/utils.py7
-rwxr-xr-xcustom_commands.json4
8 files changed, 488 insertions, 495 deletions
diff --git a/bot.py b/bot.py
index 6c0720d..12ea846 100755
--- a/bot.py
+++ b/bot.py
@@ -9,12 +9,10 @@ extensions = [
"cogs.utils",
"cogs.admin",
"cogs.src",
- "cogs.help",
"cogs.trans",
"cogs.player",
"cogs.general",
- "cogs.logs",
- "cogs.compiler"
+ "cogs.logs"
]
diff --git a/cogs/admin.py b/cogs/admin.py
index c00097b..d2b3cab 100644..100755
--- a/cogs/admin.py
+++ b/cogs/admin.py
@@ -25,11 +25,12 @@ class Admin(commands.Cog):
@commands.check(is_botmaster)
async def forceexit(self, ctx):
await ctx.send('Self Destructing')
- exit()
+ await ctx.bot.close()
@commands.command()
@commands.check(is_mod)
async def pull(self, ctx):
+ """Update the bot from github"""
g = git.cmd.Git(os.getcwd())
try:
await ctx.send(f"Probably pulled.\n```bash\n{g.pull()}```")
@@ -39,6 +40,7 @@ class Admin(commands.Cog):
@commands.command(aliases=['addcommand', 'newcommand'])
@commands.check(is_mod)
async def setcommand(self, ctx, command, *, message):
+ """Add a new simple command"""
self.bot.custom_commands[ctx.prefix + command] = message
with open('custom_commands.json', 'w') as f:
json.dump(self.bot.custom_commands, f, indent=4)
@@ -48,6 +50,7 @@ class Admin(commands.Cog):
@commands.command(aliases=['deletecommand'])
@commands.check(is_mod)
async def removecommand(self, ctx, command):
+ """Remove a simple command"""
del self.bot.custom_commands[ctx.prefix + command]
with open('custom_commands.json', 'w') as f:
json.dump(self.bot.custom_commands, f, indent=4)
@@ -103,23 +106,10 @@ class Admin(commands.Cog):
await ctx.send(f'Some unknown error happened while trying to reload extension {ext} (check logs)')
self.bot.logger.exception(f'Failed to unload extension {ext}:')
- """
- @commands.command()
- @commands.check(is_mod)
- async def connect(self, ctx):
- await ctx.author.voice.channel.connect()
- await ctx.send(f"Joined channel {ctx.author.voice.channel.name}")
-
- @commands.command()
- @commands.check(is_mod)
- async def disconnect(self, ctx):
- await ctx.voice_client.disconnect()
- await ctx.send(f"Left channel {ctx.author.voice.channel.name}")
- """
-
@commands.command()
@commands.check(is_mod)
async def clear(self, ctx, number):
+ """Mass delete messages"""
await ctx.message.channel.purge(limit=int(number)+1, check=None, before=None, after=None, around=None, oldest_first=False, bulk=True)
@commands.command()
@@ -153,6 +143,7 @@ class Admin(commands.Cog):
@commands.command()
@commands.check(is_mod)
async def unmute(self, ctx, members: commands.Greedy[discord.Member]):
+ """Remove the muted role"""
if not members:
await ctx.send("You need to name someone to unmute")
return
@@ -167,6 +158,7 @@ class Admin(commands.Cog):
@commands.command()
@commands.check(is_botmaster)
async def logs(self, ctx):
+ """Send the discord.log file"""
await ctx.message.delete()
file = discord.File("discord.log")
await ctx.send(file=file)
@@ -174,6 +166,7 @@ class Admin(commands.Cog):
@commands.command(aliases=['ban'], hidden=True)
@commands.check(is_mod)
async def blacklist(self, ctx, members: commands.Greedy[discord.Member]=None):
+ """Ban someone from using the bot"""
if not members:
await ctx.send("You need to name someone to blacklist")
return
@@ -194,6 +187,7 @@ class Admin(commands.Cog):
@commands.command()
@commands.check(is_mod)
async def activity(self, ctx, *, activity=None):
+ """Change the bot's activity"""
if activity:
game = discord.Game(activity)
else:
@@ -205,6 +199,7 @@ class Admin(commands.Cog):
@commands.command()
@commands.check(is_botmaster)
async def setvar(self, ctx, key, *, value):
+ """Set a config variable, ***use with caution**"""
with open('config.json', 'w') as f:
if value[0] == '[' and value[len(value)-1] == ']':
value = list(map(int, value[1:-1].split(',')))
@@ -214,6 +209,7 @@ class Admin(commands.Cog):
@commands.command()
@commands.check(is_mod)
async def printvar(self, ctx, key):
+ """Print a config variable, use for testing"""
await ctx.send(self.bot.config[str(ctx.message.guild.id)][key])
diff --git a/cogs/compiler.py b/cogs/compiler.py
deleted file mode 100755
index b595992..0000000
--- a/cogs/compiler.py
+++ /dev/null
@@ -1,79 +0,0 @@
-from discord.ext import commands
-import discord
-import requests
-import json
-
-class Compiler(commands.Cog):
- def __init__(self, bot):
- self.bot = bot
-
- @commands.command()
- async def compile(self, ctx, language=None, *, code=None):
- """
- listRequest = requests.get("https://wandbox.org/api/list.json")
- compilerList = json.loads(listRequest.text)
-
- for i in compilerList:
- if i["language"] == language:
- compiler = i["name"]
- print(compiler)
- """
- compilers = {
- "bash": "bash",
- "c":"gcc-head-c",
- "c#":"dotnetcore-head",
- "coffeescript": "coffeescript-head",
- "cpp": "gcc-head",
- "elixir": "elixir-head",
- "go": "go-head",
- "java": "openjdk-head",
- "javascript":"nodejs-head",
- "lua": "lua-5.3.4",
- "perl": "perl-head",
- "php": "php-head",
- "python":"cpython-3.8.0",
- "ruby": "ruby-head",
- "rust": "rust-head",
- "sql": "sqlite-head",
- "swift": "swift-5.0.1",
- "typescript":"typescript-3.5.1",
- "vim-script": "vim-head"
- }
- if not language:
- await ctx.send(f"```json\n{json.dumps(compilers, indent=4)}```")
- if not code:
- await ctx.send("No code found")
- return
- try:
- compiler = compilers[language.lower()]
- except KeyError:
- await ctx.send("Language not found")
- return
- body = {
- "compiler": compiler,
- "code": code,
- "save": True
- }
- head = {
- "Content-Type":"application/json"
- }
- async with ctx.typing():
- r = requests.post("https://wandbox.org/api/compile.json", headers=head, data=json.dumps(body))
- try:
- response = json.loads(r.text)
- #await ctx.send(f"```json\n{json.dumps(response, indent=4)}```")
- print(f"```json\n{json.dumps(response, indent=4)}```")
- except json.decoder.JSONDecodeError:
- await ctx.send(f"```json\n{r.text}```")
-
- try:
- embed=discord.Embed(title="Compiled code")
- embed.add_field(name="Output", value=f'```{response["program_message"]}```', inline=False)
- embed.add_field(name="Exit code", value=response["status"], inline=True)
- embed.add_field(name="Link", value=f"[Permalink]({response['url']})", inline=True)
- await ctx.send(embed=embed)
- except KeyError:
- await ctx.send(f"```json\n{json.dumps(response, indent=4)}```")
-
-def setup(bot):
- bot.add_cog(Compiler(bot))
diff --git a/cogs/general.py b/cogs/general.py
index 57bf044..968332b 100755
--- a/cogs/general.py
+++ b/cogs/general.py
@@ -4,6 +4,13 @@ import datetime
import requests
import json
import dateutil.parser
+from random import randint
+import os, sys, inspect
+current_dir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
+parent_dir = os.path.dirname(current_dir)
+sys.path.insert(0, parent_dir)
+import bot
+
def dump(obj):
output = ""
@@ -13,12 +20,395 @@ def dump(obj):
return output
+class MyHelpCommand(commands.MinimalHelpCommand):
+ messages = [
+ "As seen on TV!",
+ "Awesome!",
+ "100% pure!",
+ "May contain nuts!",
+ "Better than Prey!",
+ "More polygons!",
+ "Sexy!",
+ "Limited edition!",
+ "Flashing letters!",
+ "Made by Notch!",
+ "It's here!",
+ "Best in class!",
+ "It's finished!",
+ "Kind of dragon free!",
+ "Excitement!",
+ "More than 500 sold!",
+ "One of a kind!",
+ "Heaps of hits on YouTube!",
+ "Indev!",
+ "Spiders everywhere!",
+ "Check it out!",
+ "Holy cow",
+ " man!",
+ "It's a game!",
+ "Made in Sweden!",
+ "Uses LWJGL!",
+ "Reticulating splines!",
+ "Minecraft!",
+ "Yaaay!",
+ "Singleplayer!",
+ "Keyboard compatible!",
+ "Undocumented!",
+ "Ingots!",
+ "Exploding creepers!",
+ "That's no moon!",
+ "l33t!",
+ "Create!",
+ "Survive!",
+ "Dungeon!",
+ "Exclusive!",
+ "The bee's knees!",
+ "Down with O.P.P.!",
+ "Closed source!",
+ "Classy!",
+ "Wow!",
+ "Not on steam!",
+ "Oh man!",
+ "Awesome community!",
+ "Pixels!",
+ "Teetsuuuuoooo!",
+ "Kaaneeeedaaaa!",
+ "Now with difficulty!",
+ "Enhanced!",
+ "90% bug free!",
+ "Pretty!",
+ "12 herbs and spices!",
+ "Fat free!",
+ "Absolutely no memes!",
+ "Free dental!",
+ "Ask your doctor!",
+ "Minors welcome!",
+ "Cloud computing!",
+ "Legal in Finland!",
+ "Hard to label!",
+ "Technically good!",
+ "Bringing home the bacon!",
+ "Indie!",
+ "GOTY!",
+ "Ceci n'est pas une title screen!",
+ "Euclidian!",
+ "Now in 3D!",
+ "Inspirational!",
+ "Herregud!",
+ "Complex cellular automata!",
+ "Yes",
+ " sir!",
+ "Played by cowboys!",
+ "OpenGL 1.2!",
+ "Thousands of colors!",
+ "Try it!",
+ "Age of Wonders is better!",
+ "Try the mushroom stew!",
+ "Sensational!",
+ "Hot tamale",
+ " hot hot tamale!",
+ "Play him off",
+ " keyboard cat!",
+ "Guaranteed!",
+ "Macroscopic!",
+ "Bring it on!",
+ "Random splash!",
+ "Call your mother!",
+ "Monster infighting!",
+ "Loved by millions!",
+ "Ultimate edition!",
+ "Freaky!",
+ "You've got a brand new key!",
+ "Water proof!",
+ "Uninflammable!",
+ "Whoa",
+ " dude!",
+ "All inclusive!",
+ "Tell your friends!",
+ "NP is not in P!",
+ "Notch <3 ez!",
+ "Music by C418!",
+ "Livestreamed!",
+ "Haunted!",
+ "Polynomial!",
+ "Terrestrial!",
+ "All is full of love!",
+ "Full of stars!",
+ "Scientific!",
+ "Cooler than Spock!",
+ "Collaborate and listen!",
+ "Never dig down!",
+ "Take frequent breaks!",
+ "Not linear!",
+ "Han shot first!",
+ "Nice to meet you!",
+ "Buckets of lava!",
+ "Ride the pig!",
+ "Larger than Earth!",
+ "sqrt(-1) love you!",
+ "Phobos anomaly!",
+ "Punching wood!",
+ "Falling off cliffs!",
+ "0% sugar!",
+ "150% hyperbole!",
+ "Synecdoche!",
+ "Let's danec!",
+ "Seecret Friday update!",
+ "Reference implementation!",
+ "Lewd with two dudes with food!",
+ "Kiss the sky!",
+ "20 GOTO 10!",
+ "Verlet intregration!",
+ "Peter Griffin!",
+ "Do not distribute!",
+ "Cogito ergo sum!",
+ "4815162342 lines of code!",
+ "A skeleton popped out!",
+ "The Work of Notch!",
+ "The sum of its parts!",
+ "BTAF used to be good!",
+ "I miss ADOM!",
+ "umop-apisdn!",
+ "OICU812!",
+ "Bring me Ray Cokes!",
+ "Finger-licking!",
+ "Thematic!",
+ "Pneumatic!",
+ "Sublime!",
+ "Octagonal!",
+ "Une baguette!",
+ "Gargamel plays it!",
+ "Rita is the new top dog!",
+ "SWM forever!",
+ "Representing Edsbyn!",
+ "Matt Damon!",
+ "Supercalifragilisticexpialidocious!",
+ "Consummate V's!",
+ "Cow Tools!",
+ "Double buffered!",
+ "Fan fiction!",
+ "Flaxkikare!",
+ "Jason! Jason! Jason!",
+ "Hotter than the sun!",
+ "Internet enabled!",
+ "Autonomous!",
+ "Engage!",
+ "Fantasy!",
+ "DRR! DRR! DRR!",
+ "Kick it root down!",
+ "Regional resources!",
+ "Woo",
+ " facepunch!",
+ "Woo",
+ " somethingawful!",
+ "Woo",
+ " /v/!",
+ "Woo",
+ " tigsource!",
+ "Woo",
+ " minecraftforum!",
+ "Woo",
+ " worldofminecraft!",
+ "Woo",
+ " reddit!",
+ "Woo",
+ " 2pp!",
+ "Google anlyticsed!",
+ "Now supports åäö!",
+ "Give us Gordon!",
+ "Tip your waiter!",
+ "Very fun!",
+ "12345 is a bad password!",
+ "Vote for net neutrality!",
+ "Lives in a pineapple under the sea!",
+ "MAP11 has two names!",
+ "Omnipotent!",
+ "Gasp!",
+ "...!",
+ "Bees",
+ " bees",
+ " bees",
+ " bees!",
+ "Jag känner en bot!",
+ "This text is hard to read if you play the game at the default resolution",
+ " but at 1080p it's fine!",
+ "Haha",
+ " LOL!",
+ "Hampsterdance!",
+ "Switches and ores!",
+ "Menger sponge!",
+ "idspispopd!",
+ "Eple (original edit)!",
+ "So fresh",
+ " so clean!",
+ "Slow acting portals!",
+ "Try the Nether!",
+ "Don't look directly at the bugs!",
+ "Oh",
+ " ok",
+ " Pigmen!",
+ "Finally with ladders!",
+ "Scary!",
+ "Play Minecraft",
+ " Watch Topgear",
+ " Get Pig!",
+ "Twittered about!",
+ "Jump up",
+ " jump up",
+ " and get down!",
+ "Joel is neat!",
+ "A riddle",
+ " wrapped in a mystery!",
+ "Huge tracts of land!",
+ "Welcome to your Doom!",
+ "Stay a while",
+ " stay forever!",
+ "Stay a while and listen!",
+ "Treatment for your rash!",
+ "\"Autological\" is!",
+ "Information wants to be free!",
+ "\"Almost never\" is an interesting concept!",
+ "Lots of truthiness!",
+ "The creeper is a spy!",
+ "Turing complete!",
+ "It's groundbreaking!",
+ "Let our battle's begin!",
+ "The sky is the limit!",
+ "Jeb has amazing hair!",
+ "Ryan also has amazing hair!",
+ "Casual gaming!",
+ "Undefeated!",
+ "Kinda like Lemmings!",
+ "Follow the train",
+ " CJ!",
+ "Leveraging synergy!",
+ "This message will never appear on the splash screen",
+ " isn't that weird?",
+ "DungeonQuest is unfair!",
+ "110813!",
+ "90210!",
+ "Check out the far lands!",
+ "Tyrion would love it!",
+ "Also try VVVVVV!",
+ "Also try Super Meat Boy!",
+ "Also try Terraria!",
+ "Also try Mount And Blade!",
+ "Also try Project Zomboid!",
+ "Also try World of Goo!",
+ "Also try Limbo!",
+ "Also try Pixeljunk Shooter!",
+ "Also try Braid!",
+ "That's super!",
+ "Bread is pain!",
+ "Read more books!",
+ "Khaaaaaaaaan!",
+ "Less addictive than TV Tropes!",
+ "More addictive than lemonade!",
+ "Bigger than a bread box!",
+ "Millions of peaches!",
+ "Fnord!",
+ "This is my true form!",
+ "Totally forgot about Dre!",
+ "Don't bother with the clones!",
+ "Pumpkinhead!",
+ "Hobo humping slobo babe!",
+ "Made by Jeb!",
+ "Has an ending!",
+ "Finally complete!",
+ "Feature packed!",
+ "Boots with the fur!",
+ "Stop",
+ " hammertime!",
+ "Testificates!",
+ "Conventional!",
+ "Homeomorphic to a 3-sphere!",
+ "Doesn't avoid double negatives!",
+ "Place ALL the blocks!",
+ "Does barrel rolls!",
+ "Meeting expectations!",
+ "PC gaming since 1873!",
+ "Ghoughpteighbteau tchoghs!",
+ "Déjà vu!",
+ "Déjà vu!",
+ "Got your nose!",
+ "Haley loves Elan!",
+ "Afraid of the big",
+ " black bat!",
+ "Doesn't use the U-word!",
+ "Child's play!",
+ "See you next Friday or so!",
+ "From the streets of Södermalm!",
+ "150 bpm for 400000 minutes!",
+ "Technologic!",
+ "Funk soul brother!",
+ "Pumpa kungen!",
+ "日本ハロー!",
+ "한국 안녕하세요!",
+ "Helo Cymru!",
+ "Cześć Polsko!",
+ "你好中国!",
+ "Привет Россия!",
+ "Γεια σου Ελλάδα!",
+ "My life for Aiur!",
+ "Lennart lennart = new Lennart();",
+ "I see your vocabulary has improved!",
+ "Who put it there?",
+ "You can't explain that!",
+ "if not ok then return end",
+ "§1C§2o§3l§4o§5r§6m§7a§8t§9i§ac",
+ "§kFUNKY LOL",
+ "SOPA means LOSER in Swedish!",
+ "Big Pointy Teeth!",
+ "Bekarton guards the gate!",
+ "Mmmph",
+ " mmph!",
+ "Don't feed avocados to parrots!",
+ "Swords for everyone!",
+ "Plz reply to my tweet!",
+ ".party()!",
+ "Take her pillow!",
+ "Put that cookie down!",
+ "Pretty scary!",
+ "I have a suggestion.",
+ "Now with extra hugs!",
+ "Now java 6!",
+ "Woah.",
+ "HURNERJSGER?",
+ "What's up",
+ " Doc?",
+ "Now contains 32 random daily cats!",
+ ""]
+ def get_command_signature(self, command):
+ return f'``{self.clean_prefix}{command.qualified_name} {command.signature}``'
+ def get_ending_note(self):
+ return self.messages[randint(0, len(self.messages)-1)]
+
class General(commands.Cog):
def __init__(self, bot):
self.bot = bot
+ self._original_help_command = bot.help_command
+ bot.help_command = MyHelpCommand()
+ bot.help_command.cog = self
+
+ def cog_unload(self):
+ self.bot.help_command = self._original_help_command
+
+ @commands.command()
+ async def prefix(self, ctx):
+ """Gets the bot prefixes"""
+ prefixes = bot.get_prefix(self.bot, ctx.message)
+ prefixes.pop(1)
+ prefixes.pop(1)
+ prefixes.pop(1)
+ output = ""
+ for i in prefixes:
+ output += i+", "
+
+ await ctx.send(f"My prefixes are {output}")
@commands.command()
async def userinfo(self, ctx, user: discord.Member=None):
+ """Get information about a user"""
#await ctx.send(f"```py\n{dump(user)}```")
if not user:
@@ -48,6 +438,7 @@ class General(commands.Cog):
@commands.command()
async def coop(self, ctx, *, user: discord.Member=None):
+ """Get the coop gang role"""
if not user:
user = ctx.message.author
else:
@@ -64,6 +455,7 @@ class General(commands.Cog):
@commands.command()
async def serverinfo(self, ctx, guild=None):
+ """Get information about the server you are in"""
if not guild:
guild = ctx.message.guild
else:
@@ -90,7 +482,8 @@ class General(commands.Cog):
await ctx.send(embed=embed)
@commands.command()
- async def xboxUser(self, ctx, *, gamertag=None):
+ async def xboxuser(self, ctx, *, gamertag=None):
+ """Get information about an xbox live user"""
if not gamertag:
await ctx.send("You need to specify a gamer, gamer")
return
@@ -151,7 +544,7 @@ class General(commands.Cog):
embed.add_field(name="Reputation", value=reputation, inline=True)
await ctx.send(embed=embed)
- @commands.command()
+ @commands.command(hidden=True)
async def xboxpresence(self, ctx, *, gamertag=None):
if not gamertag:
await ctx.send("You need to specify a gamer, gamer")
@@ -187,5 +580,74 @@ class General(commands.Cog):
embed=discord.Embed(title=gamer["gamertag"], description=state, timestamp=ctx.message.created_at)
await ctx.send(embed=embed)
+ @commands.command()
+ async def compile(self, ctx, language=None, *, code=None):
+ """Compile code from a variety of programming languages, powered by <https://wandbox.org/>"""
+ """
+ listRequest = requests.get("https://wandbox.org/api/list.json")
+ compilerList = json.loads(listRequest.text)
+
+ for i in compilerList:
+ if i["language"] == language:
+ compiler = i["name"]
+ print(compiler)
+ """
+ compilers = {
+ "bash": "bash",
+ "c":"gcc-head-c",
+ "c#":"dotnetcore-head",
+ "coffeescript": "coffeescript-head",
+ "cpp": "gcc-head",
+ "elixir": "elixir-head",
+ "go": "go-head",
+ "java": "openjdk-head",
+ "javascript":"nodejs-head",
+ "lua": "lua-5.3.4",
+ "perl": "perl-head",
+ "php": "php-head",
+ "python":"cpython-3.8.0",
+ "ruby": "ruby-head",
+ "rust": "rust-head",
+ "sql": "sqlite-head",
+ "swift": "swift-5.0.1",
+ "typescript":"typescript-3.5.1",
+ "vim-script": "vim-head"
+ }
+ if not language:
+ await ctx.send(f"```json\n{json.dumps(compilers, indent=4)}```")
+ if not code:
+ await ctx.send("No code found")
+ return
+ try:
+ compiler = compilers[language.lower()]
+ except KeyError:
+ await ctx.send("Language not found")
+ return
+ body = {
+ "compiler": compiler,
+ "code": code,
+ "save": True
+ }
+ head = {
+ "Content-Type":"application/json"
+ }
+ async with ctx.typing():
+ r = requests.post("https://wandbox.org/api/compile.json", headers=head, data=json.dumps(body))
+ try:
+ response = json.loads(r.text)
+ #await ctx.send(f"```json\n{json.dumps(response, indent=4)}```")
+ print(f"```json\n{json.dumps(response, indent=4)}```")
+ except json.decoder.JSONDecodeError:
+ await ctx.send(f"```json\n{r.text}```")
+
+ try:
+ embed=discord.Embed(title="Compiled code")
+ embed.add_field(name="Output", value=f'```{response["program_message"]}```', inline=False)
+ embed.add_field(name="Exit code", value=response["status"], inline=True)
+ embed.add_field(name="Link", value=f"[Permalink]({response['url']})", inline=True)
+ await ctx.send(embed=embed)
+ except KeyError:
+ await ctx.send(f"```json\n{json.dumps(response, indent=4)}```")
+
def setup(bot):
bot.add_cog(General(bot))
diff --git a/cogs/help.py b/cogs/help.py
deleted file mode 100755
index 91c9c45..0000000
--- a/cogs/help.py
+++ /dev/null
@@ -1,395 +0,0 @@
-from discord.ext import commands
-from random import randint
-import os, sys, inspect
-current_dir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
-parent_dir = os.path.dirname(current_dir)
-sys.path.insert(0, parent_dir)
-import bot
-
-class MyHelpCommand(commands.MinimalHelpCommand):
- messages = [
- "As seen on TV!",
- "Awesome!",
- "100% pure!",
- "May contain nuts!",
- "Better than Prey!",
- "More polygons!",
- "Sexy!",
- "Limited edition!",
- "Flashing letters!",
- "Made by Notch!",
- "It's here!",
- "Best in class!",
- "It's finished!",
- "Kind of dragon free!",
- "Excitement!",
- "More than 500 sold!",
- "One of a kind!",
- "Heaps of hits on YouTube!",
- "Indev!",
- "Spiders everywhere!",
- "Check it out!",
- "Holy cow",
- " man!",
- "It's a game!",
- "Made in Sweden!",
- "Uses LWJGL!",
- "Reticulating splines!",
- "Minecraft!",
- "Yaaay!",
- "Singleplayer!",
- "Keyboard compatible!",
- "Undocumented!",
- "Ingots!",
- "Exploding creepers!",
- "That's no moon!",
- "l33t!",
- "Create!",
- "Survive!",
- "Dungeon!",
- "Exclusive!",
- "The bee's knees!",
- "Down with O.P.P.!",
- "Closed source!",
- "Classy!",
- "Wow!",
- "Not on steam!",
- "Oh man!",
- "Awesome community!",
- "Pixels!",
- "Teetsuuuuoooo!",
- "Kaaneeeedaaaa!",
- "Now with difficulty!",
- "Enhanced!",
- "90% bug free!",
- "Pretty!",
- "12 herbs and spices!",
- "Fat free!",
- "Absolutely no memes!",
- "Free dental!",
- "Ask your doctor!",
- "Minors welcome!",
- "Cloud computing!",
- "Legal in Finland!",
- "Hard to label!",
- "Technically good!",
- "Bringing home the bacon!",
- "Indie!",
- "GOTY!",
- "Ceci n'est pas une title screen!",
- "Euclidian!",
- "Now in 3D!",
- "Inspirational!",
- "Herregud!",
- "Complex cellular automata!",
- "Yes",
- " sir!",
- "Played by cowboys!",
- "OpenGL 1.2!",
- "Thousands of colors!",
- "Try it!",
- "Age of Wonders is better!",
- "Try the mushroom stew!",
- "Sensational!",
- "Hot tamale",
- " hot hot tamale!",
- "Play him off",
- " keyboard cat!",
- "Guaranteed!",
- "Macroscopic!",
- "Bring it on!",
- "Random splash!",
- "Call your mother!",
- "Monster infighting!",
- "Loved by millions!",
- "Ultimate edition!",
- "Freaky!",
- "You've got a brand new key!",
- "Water proof!",
- "Uninflammable!",
- "Whoa",
- " dude!",
- "All inclusive!",
- "Tell your friends!",
- "NP is not in P!",
- "Notch <3 ez!",
- "Music by C418!",
- "Livestreamed!",
- "Haunted!",
- "Polynomial!",
- "Terrestrial!",
- "All is full of love!",
- "Full of stars!",
- "Scientific!",
- "Cooler than Spock!",
- "Collaborate and listen!",
- "Never dig down!",
- "Take frequent breaks!",
- "Not linear!",
- "Han shot first!",
- "Nice to meet you!",
- "Buckets of lava!",
- "Ride the pig!",
- "Larger than Earth!",
- "sqrt(-1) love you!",
- "Phobos anomaly!",
- "Punching wood!",
- "Falling off cliffs!",
- "0% sugar!",
- "150% hyperbole!",
- "Synecdoche!",
- "Let's danec!",
- "Seecret Friday update!",
- "Reference implementation!",
- "Lewd with two dudes with food!",
- "Kiss the sky!",
- "20 GOTO 10!",
- "Verlet intregration!",
- "Peter Griffin!",
- "Do not distribute!",
- "Cogito ergo sum!",
- "4815162342 lines of code!",
- "A skeleton popped out!",
- "The Work of Notch!",
- "The sum of its parts!",
- "BTAF used to be good!",
- "I miss ADOM!",
- "umop-apisdn!",
- "OICU812!",
- "Bring me Ray Cokes!",
- "Finger-licking!",
- "Thematic!",
- "Pneumatic!",
- "Sublime!",
- "Octagonal!",
- "Une baguette!",
- "Gargamel plays it!",
- "Rita is the new top dog!",
- "SWM forever!",
- "Representing Edsbyn!",
- "Matt Damon!",
- "Supercalifragilisticexpialidocious!",
- "Consummate V's!",
- "Cow Tools!",
- "Double buffered!",
- "Fan fiction!",
- "Flaxkikare!",
- "Jason! Jason! Jason!",
- "Hotter than the sun!",
- "Internet enabled!",
- "Autonomous!",
- "Engage!",
- "Fantasy!",
- "DRR! DRR! DRR!",
- "Kick it root down!",
- "Regional resources!",
- "Woo",
- " facepunch!",
- "Woo",
- " somethingawful!",
- "Woo",
- " /v/!",
- "Woo",
- " tigsource!",
- "Woo",
- " minecraftforum!",
- "Woo",
- " worldofminecraft!",
- "Woo",
- " reddit!",
- "Woo",
- " 2pp!",
- "Google anlyticsed!",
- "Now supports åäö!",
- "Give us Gordon!",
- "Tip your waiter!",
- "Very fun!",
- "12345 is a bad password!",
- "Vote for net neutrality!",
- "Lives in a pineapple under the sea!",
- "MAP11 has two names!",
- "Omnipotent!",
- "Gasp!",
- "...!",
- "Bees",
- " bees",
- " bees",
- " bees!",
- "Jag känner en bot!",
- "This text is hard to read if you play the game at the default resolution",
- " but at 1080p it's fine!",
- "Haha",
- " LOL!",
- "Hampsterdance!",
- "Switches and ores!",
- "Menger sponge!",
- "idspispopd!",
- "Eple (original edit)!",
- "So fresh",
- " so clean!",
- "Slow acting portals!",
- "Try the Nether!",
- "Don't look directly at the bugs!",
- "Oh",
- " ok",
- " Pigmen!",
- "Finally with ladders!",
- "Scary!",
- "Play Minecraft",
- " Watch Topgear",
- " Get Pig!",
- "Twittered about!",
- "Jump up",
- " jump up",
- " and get down!",
- "Joel is neat!",
- "A riddle",
- " wrapped in a mystery!",
- "Huge tracts of land!",
- "Welcome to your Doom!",
- "Stay a while",
- " stay forever!",
- "Stay a while and listen!",
- "Treatment for your rash!",
- "\"Autological\" is!",
- "Information wants to be free!",
- "\"Almost never\" is an interesting concept!",
- "Lots of truthiness!",
- "The creeper is a spy!",
- "Turing complete!",
- "It's groundbreaking!",
- "Let our battle's begin!",
- "The sky is the limit!",
- "Jeb has amazing hair!",
- "Ryan also has amazing hair!",
- "Casual gaming!",
- "Undefeated!",
- "Kinda like Lemmings!",
- "Follow the train",
- " CJ!",
- "Leveraging synergy!",
- "This message will never appear on the splash screen",
- " isn't that weird?",
- "DungeonQuest is unfair!",
- "110813!",
- "90210!",
- "Check out the far lands!",
- "Tyrion would love it!",
- "Also try VVVVVV!",
- "Also try Super Meat Boy!",
- "Also try Terraria!",
- "Also try Mount And Blade!",
- "Also try Project Zomboid!",
- "Also try World of Goo!",
- "Also try Limbo!",
- "Also try Pixeljunk Shooter!",
- "Also try Braid!",
- "That's super!",
- "Bread is pain!",
- "Read more books!",
- "Khaaaaaaaaan!",
- "Less addictive than TV Tropes!",
- "More addictive than lemonade!",
- "Bigger than a bread box!",
- "Millions of peaches!",
- "Fnord!",
- "This is my true form!",
- "Totally forgot about Dre!",
- "Don't bother with the clones!",
- "Pumpkinhead!",
- "Hobo humping slobo babe!",
- "Made by Jeb!",
- "Has an ending!",
- "Finally complete!",
- "Feature packed!",
- "Boots with the fur!",
- "Stop",
- " hammertime!",
- "Testificates!",
- "Conventional!",
- "Homeomorphic to a 3-sphere!",
- "Doesn't avoid double negatives!",
- "Place ALL the blocks!",
- "Does barrel rolls!",
- "Meeting expectations!",
- "PC gaming since 1873!",
- "Ghoughpteighbteau tchoghs!",
- "Déjà vu!",
- "Déjà vu!",
- "Got your nose!",
- "Haley loves Elan!",
- "Afraid of the big",
- " black bat!",
- "Doesn't use the U-word!",
- "Child's play!",
- "See you next Friday or so!",
- "From the streets of Södermalm!",
- "150 bpm for 400000 minutes!",
- "Technologic!",
- "Funk soul brother!",
- "Pumpa kungen!",
- "日本ハロー!",
- "한국 안녕하세요!",
- "Helo Cymru!",
- "Cześć Polsko!",
- "你好中国!",
- "Привет Россия!",
- "Γεια σου Ελλάδα!",
- "My life for Aiur!",
- "Lennart lennart = new Lennart();",
- "I see your vocabulary has improved!",
- "Who put it there?",
- "You can't explain that!",
- "if not ok then return end",
- "§1C§2o§3l§4o§5r§6m§7a§8t§9i§ac",
- "§kFUNKY LOL",
- "SOPA means LOSER in Swedish!",
- "Big Pointy Teeth!",
- "Bekarton guards the gate!",
- "Mmmph",
- " mmph!",
- "Don't feed avocados to parrots!",
- "Swords for everyone!",
- "Plz reply to my tweet!",
- ".party()!",
- "Take her pillow!",
- "Put that cookie down!",
- "Pretty scary!",
- "I have a suggestion.",
- "Now with extra hugs!",
- "Now java 6!",
- "Woah.",
- "HURNERJSGER?",
- "What's up",
- " Doc?",
- "Now contains 32 random daily cats!",
- ""]
- def get_command_signature(self, command):
- return f'``{self.clean_prefix}{command.qualified_name} {command.signature}``'
- def get_ending_note(self):
- return self.messages[randint(0, len(self.messages)-1)]
-
-class Help(commands.Cog):
- def __init__(self, bot):
- self.bot = bot
- self._original_help_command = bot.help_command
- bot.help_command = MyHelpCommand()
- bot.help_command.cog = self
-
- def cog_unload(self):
- self.bot.help_command = self._original_help_command
-
- @commands.command()
- async def prefix(self, ctx):
- prefixes = bot.get_prefix(self.bot, ctx.message)
- prefixes.pop(1)
- prefixes.pop(1)
- prefixes.pop(1)
- output = ""
- for i in prefixes:
- output += i+", "
-
- await ctx.send(f"My prefixes are {output}")
-
-def setup(bot):
- bot.add_cog(Help(bot))
diff --git a/cogs/trans.py b/cogs/trans.py
index 9c5d307..9ca1004 100755
--- a/cogs/trans.py
+++ b/cogs/trans.py
@@ -31,6 +31,7 @@ class Trans(commands.Cog):
@commands.command(help="Translate text in english (using google translate)", brief="Translate to english", aliases=["翻译", "脑热", "动漫"])
async def translate(self, ctx, *, message):
+ """Translate to english"""
response = await translateMsg(message)
embed=discord.Embed(title="Translation",description=f"{ctx.message.author.mention} says:", timestamp=ctx.message.created_at, color=0x4d9aff)
embed.add_field(name=f"[{response['detectedSourceLanguage']}] Source:" , value=response['input'], inline=False)
@@ -39,6 +40,7 @@ class Trans(commands.Cog):
@commands.command()
async def trans(self, ctx, lan, *, message):
+ """Translate to a specific language"""
response = await translateMsg(message, lan)
embed=discord.Embed(title="Translation",description=f"{ctx.message.author.mention} says:", timestamp=ctx.message.created_at, color=0x4d9aff)
embed.add_field(name=f"[{response['detectedSourceLanguage']}] Source:" , value=response['input'], inline=False)
diff --git a/cogs/utils.py b/cogs/utils.py
index 6227e0a..be0d09c 100755
--- a/cogs/utils.py
+++ b/cogs/utils.py
@@ -48,6 +48,7 @@ class Utils(commands.Cog):
@commands.cooldown(1, 25, commands.BucketType.guild)
@commands.command()
async def findseed(self, ctx):
+ """Test yout luck"""
if ctx.message.channel.id != int(self.bot.config[str(ctx.message.guild.id)]["bot_channel"]):
await ctx.message.delete()
ctx.command.reset_cooldown(ctx)
@@ -83,6 +84,7 @@ class Utils(commands.Cog):
@commands.command()
async def findsleep(self, ctx):
+ """Test your sleep"""
if ctx.message.channel.id != int(self.bot.config[str(ctx.message.guild.id)]["bot_channel"]):
await ctx.message.delete()
return
@@ -162,6 +164,7 @@ class Utils(commands.Cog):
@commands.cooldown(1, 60, commands.BucketType.member)
@commands.command()
async def report(self, ctx, *, message=None):
+ """Send a message to the super mods about anything"""
if ctx.message.guild != None:
await ctx.message.delete()
if message == None:
@@ -172,6 +175,7 @@ class Utils(commands.Cog):
@commands.cooldown(1, 20, commands.BucketType.member)
@commands.command()
async def leaderboard(self, ctx):
+ """Leaderboard of the people that matter"""
async with ctx.typing():
DRIVER = '/usr/lib/chromium-browser/chromedriver'
chrome_options = Options()
@@ -223,15 +227,18 @@ class Utils(commands.Cog):
@commands.cooldown(1, 60, commands.BucketType.guild)
@commands.command()
async def someone(self, ctx):
+ """Discord's mistake"""
if ctx.channel.id != int(self.bot.config[str(ctx.message.guild.id)]["fair_channel"]):
await ctx.send(choice(ctx.guild.members).mention)
@commands.command()
async def roll(self, ctx, pool):
+ """Toll the dice"""
await ctx.send(f"You rolled a {randint(0, int(pool))}")
@commands.command(aliases=['commands', 'allcommands'])
async def listcommands(self, ctx):
+ """List all custom commands"""
with open('custom_commands.json', 'r') as f:
commands = json.load(f)
output = '```List of custom commands:\n'
diff --git a/custom_commands.json b/custom_commands.json
index f0a3d4b..884bbf4 100755
--- a/custom_commands.json
+++ b/custom_commands.json
@@ -35,5 +35,7 @@
"!learntoread": "When two players are tied on the leaderboards **ONLY ONE FUCKER WILL BE VISIBLE**",
"!mobiledupe": "1) place item to dupe in the crafting grid\n2) keep pressed until the green bar thing appears\nclick any \"Impossible\" craft (red ones)\n3)press the item to dupe (that is in your hotbar now -> it should have moved there since you pressed the impossible craft)\n4)your item should be duped",
"!source": "https://github.com/AnInternetTroll/mcbeDiscordBot",
- "!sr.c": "https://www.speedrun.com/mcbe"
+ "!sr.c": "https://www.speedrun.com/mcbe",
+ "!lbsite": "https://aninternettroll.github.io/mcbeVerifierLeaderboard/index.html",
+ "!leaderboardsite": "https://aninternettroll.github.io/mcbeVerifierLeaderboard/index.html"
} \ No newline at end of file