diff --git a/bot.py b/bot.py index 1584f5a..4bc788e 100644 --- a/bot.py +++ b/bot.py @@ -24,6 +24,8 @@ class Bot(commands.Bot): commands = self.db_cur.execute("SELECT count(*) FROM custom_commands").fetchone() print(f"{commands[0]} custom commands available") + self.last_message = "cubes are just balls with corners lmao" + # Adds a custom command from a string async def add_custom_command(self, ctx, command_str, author): args = command_str.split(" ", 1) @@ -86,6 +88,9 @@ class Bot(commands.Bot): await self.handle_commands(message) + if len(message.content.split(" ")) > 1: + self.last_message = message.content + @commands.command() async def hello(self, ctx: commands.Context): # Basic hello world command, executed with "!hello". Reply hello to whoever made the command @@ -161,6 +166,12 @@ class Bot(commands.Bot): r = requests.get("https://taskinoz.com/gdq/api/") await ctx.send(r.text) + @commands.command() + async def shuffle(self, ctx: commands.Context): + shuffled_message_list = self.last_message.split(" ") + random.shuffle(shuffled_message_list) + await ctx.send(" ".join(shuffled_message_list)) + def main(): load_dotenv()