from time import sleep import discord import dotenv from discord.ext import commands import random import threading import datetime from functools import partial, wraps import json import urllib.request from RobloxAPI.main import RobloxMarketPlaceAPI import math # from commands.funny import BigCommands class BigResultPlus(commands.Bot): def __init__(self, intents, command_prefix): super().__init__(intents=intents, command_prefix=command_prefix) self.snipe_active = False self.COMMANDS = { "snipe": BigResultPlus.snipe, "bigresult": BigResultPlus.teach, "mod": BigResultPlus.mod, "1984": BigResultPlus.orwell, "teachmethebigresult": BigResultPlus.teachbigresult, "ivotedfor": BigResultPlus.voot, } self.daily_pi_update_msg = "rise and shine bastards, server time is ;;date;; and the Pumpkin Pi is ;;robux;; and Avi has ;;profit?;; ;;amount;; robux" self.roblox_api_url = "https://catalog.roblox.com/v1/search/items/details?" self.pumpkin_pi_buy = 800 self.robloxAPI = RobloxMarketPlaceAPI() # intents = discord.Intents.all() # self.client = commands.Bot(intents=intents, command_prefix="!") # This represents our connection with Discord def initialize_commands(self): for key in self.COMMANDS: super().command(name=key)(wraps(self.COMMANDS[key])(partial(self.COMMANDS[key], self))) def riseandshine(self): next_day = datetime.datetime.now() next_day = next_day.replace(day=next_day.day + 1) self.robloxAPI.configure_request("CreatorName", "Roblox") self.robloxAPI.configure_request("Keyword", "Pumpkin Pi") self.robloxAPI.configure_request("Limit", "10") self.robloxAPI.configure_request("TARGET", 16986805) while True: today = datetime.datetime.now() if (today < next_day): sleep(60*60) next_day = today.replace(day=today.day + 1) if not self.robloxAPI.send_request(): return pumpkinpi = self.robloxAPI.read_response() update_msg = self.daily_pi_update_msg.replace(";;date;;", today.isoformat()) update_msg = update_msg.replace(";;robux;;", f"{pumpkinpi["lowestPrice"]}") if self.pumpkin_pi_buy - pumpkinpi["lowestPrice"] < 0: update_msg = update_msg.replace(";;profit?;;", "gained") else: update_msg = update_msg.replace(";;profit?;;", "lost (LOL)") update_msg = update_msg.replace(";;amount;;", f"{abs(self.pumpkin_pi_buy - pumpkinpi["lowestPrice"])}") self.send_msg(update_msg, 0) # @client.command(name="snipe") async def snipe(self, ctx): await ctx.reply("watch yourself") self.snipe_active = True pass # @client.command(name="bigresult") async def teach(self, ctx): await ctx.reply( "https://cdn.discordapp.com/attachments/427176475406630914/1302392181448900649/image.png?ex=6727f2bd&is=6726a13d&hm=6092f4fba06412feac26a16a6900bf6e6122d66506f60bfcc0bc7101ecede4db&") # @client.command(name="mod") async def mod(self, ctx): await ctx.reply( ">>> *pees in ur ass*\nI am a bot and this action was performed automatically. Please contact the moderators of this server if you have any questions or concerns.") # @client.command(name="1984") async def orwell(self, ctx): if (random.randint(1, 5) == 2): await ctx.reply(f">>> {ctx.author} has been warned: \n\nBad word usage") else: await ctx.reply( "https://media.discordapp.net/attachments/865417026519957526/866575047459209236/video0-1-1.mov?ex=672d0e27&is=672bbca7&hm=3c80837685cb800ad817855b6463e4e1875dc009c6fc4540eff749c7387c4241&") # @client.command(name="teachmethebigresult") async def teachbigresult(self, ctx): await ctx.reply("take b36 with Nick Cheng. join the 'Big Result' club") # @client.command(name="ivotedfor") async def voot(self, ctx): if (random.randint(1, 2) == 2): await ctx.reply("Donald trump sweeep") else: await ctx.reply("Kamala harris sweeep") async def on_ready(self): print("The big result plus bot is ready!") await self.send_msg("Hurlo") async def on_message(self, message): # roblox = discord.utils.get(self.client.emojis, name="roblos") fuckyou = message.content.lower() channel_sent = message.channel if (self.snipe_active): if (random.randint(1, 400) == 333): saved = message.content await channel_sent.send("BOOM :sunglasses: :fire:") await message.delete() sleep(2) await channel_sent.send(saved) self.snipe_active = False """ I want these statements moved into a function that is run on another thread so we don't get super bad performance hits """ if message.author == super().user: return if (random.randint(1, 2000) == 1984): await message.reply("thats crazy") return if (random.randint(1, 20000) == 67): await message.reply("whatcha saayyy") return elif ("1984" in fuckyou and "!1984" != fuckyou): await message.reply("kys") return elif ("roblox" in fuckyou or "roblo" in fuckyou or "road blocks" in fuckyou): # await message.add_reaction(roblox) await message.reply( "life is roblox\nhttps://cdn.discordapp.com/attachments/890681829915508806/1066566357694562374/DJ_Khaled.mp4?ex=6728ee13&is=67279c93&hm=7a2c5e3c85d42ee07c420424fc26970f502e941f9d1c45324b42270184a17b65&") return elif ("matrix" in fuckyou): await message.reply("be a good kitten") return elif ("gift card" in fuckyou): await message.reply("DO NOT REDEEM! DO NOT REDEEM THE CARD!") self.state = 1 return elif ("andrew tate" in fuckyou): await message.reply("andro tate") return elif ("gamba" in fuckyou or "gamble" in fuckyou or "bet" in fuckyou): await message.reply("Google Expected Value") return elif ("sex" in fuckyou): if super().voice_clients is None: return elif ("im gonna redeem" in fuckyou and self.state == 1): await message.reply("NOOOOOOOOOOOOO NO NO NOOOOOOOOOO!") self.state = 0 return elif ("president" in fuckyou or "trump" in fuckyou or "kamala" in fuckyou): await message.reply("Should have voted for Taylor Swift and Al Gore, Swift-Gore") return elif ("?" in fuckyou and random.randint(1, 2000) == 1984): await message.reply("did you attend?") sleep(1) await message.reply("were you there?") sleep(1) await message.reply("were you listening?") sleep(1) await message.reply("why do you ask?") return await super().process_commands(message) return async def send_msg(self, msg, channel): channel = super().get_channel(channel) await channel.send(msg)