Skip to content

Commit

Permalink
stag
Browse files Browse the repository at this point in the history
  • Loading branch information
paixlukee committed Feb 12, 2025
1 parent 7a6aef2 commit b747614
Show file tree
Hide file tree
Showing 40 changed files with 4,736 additions and 1,333 deletions.
Binary file added __pycache__/awards.cpython-313.pyc
Binary file not shown.
Binary file added __pycache__/extra.cpython-313.pyc
Binary file not shown.
Binary file added __pycache__/food.cpython-313.pyc
Binary file not shown.
Binary file added __pycache__/items.cpython-313.pyc
Binary file not shown.
Binary file added __pycache__/quests.cpython-313.pyc
Binary file not shown.
Binary file added __pycache__/responses.cpython-313.pyc
Binary file not shown.
Binary file added __pycache__/songs.cpython-313.pyc
Binary file not shown.
Binary file added __pycache__/trivia.cpython-313.pyc
Binary file not shown.
Binary file added __pycache__/workers.cpython-313.pyc
Binary file not shown.
18 changes: 18 additions & 0 deletions awards.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
all_awards = ["first_task", "set_banner", "logo_approved", "ten_tasks", "thirty_tasks", "twohundred_customers", "sevenhundred_customers", "fifteenhundred_customers"]

awards = {
"set_banner": {"name": "Marketing Expert", "emoji": "<:MarketingExpert:1328604611811999764>", "grey_emoji": "<:MarketingExpertA:1328604929442447381>", "description": "Set your banner for the first time"},
"logo_approved": {"name": "Graphic Designer", "emoji": "<:GraphicDesigner:1328575306809872446>", "grey_emoji": "<:GraphicDesignerA:1328576242856755304>", "description": "Get a logo approved for the first time"},
"worker": {"name": "Teamwork", "emoji": "<:Teamwork:1328580116682506320>", "grey_emoji": "<:TeamworkA:1328580963390717974>", "description": "Hire your first worker"},
"broken_pole": {"name": "Sad Fisherman", "emoji": "<:SadFisherman:1328584022258876487>", "grey_emoji": "<:SadFishermanA:1328584079452536832>", "description": "Break your first fishing pole"},
"first_task": {"name": "Hardworker", "emoji": "<:Hardworker:1328590454362607626>", "grey_emoji": "<:HardworkerA:1328591604675641377>", "description": "Complete your first weekly task"},
"ten_tasks": {"name": "Busy Entrepreneur", "emoji": "<:BusyEntrepreneur:1328586064729866310>", "grey_emoji": "<:BusyEntrepreneurA:1328586447141343273>", "description": "Complete 10 weekly tasks"},
"thirty_tasks": {"name": "Boss & CEO", "emoji": "<:BossAndCEO:1328588381755805807>", "grey_emoji": "<:BossAndCEOa:1328588893875863637>", "description": "Complete 30 weekly tasks"},
"fivehundred_customers": {"name": "Poppin' Business", "emoji": "<:PoppinBusiness:1328605926672039968>", "grey_emoji": "<:PoppinBusinessA:1328606234416250880>", "description": "Reach 500 customers"},
"fifteenhundred_customers": {"name": "Hotspot", "emoji": "<:Hotspot:1328608005423366146>", "grey_emoji": "<:HotspotA:1328608591783002173>", "description": "Reach 1500 customers"},
"threethousand_customers": {"name": "The Talk of the Town", "emoji": "<:TalkOfTheTown:1328610599911030836>", "grey_emoji": "<:TalkOfTheTownA:1328610919722385530>", "description": "Reach 3000 customers"},
"fivethousand_customers": {"name": "Michelin Restaurant", "emoji": "<:MichelinRestaurant:1328612407941136414>", "grey_emoji": "<:MichelinRestaurantA:1328612738490175529>", "description": "Reach 5000 customers"},
"fivehundred_bbux": {"name": "Pretty Penny", "emoji": "<:PrettyPenny:1328597160203391058>", "grey_emoji": "<:PrettyPennyA:1328597436825997332>", "description": "Have a balance of 500 BB"},
"thousand_bbux": {"name": "Moneybags", "emoji": "<:Moneybags:1328599838593519677>", "grey_emoji": "<:MoneybagsA:1328600139966971924>", "description": "Have a balance of 1000 BB"},
"twothousand_bbux": {"name": "Stacks on Stacks", "emoji": "<:StacksOnStacks:1328601339088998401>", "grey_emoji": "<:StacksOnStacksA:1328601896767717457>", "description": "Have a balance of 2000 BB"}
}
Binary file added cogs/__pycache__/bot.cpython-313.pyc
Binary file not shown.
Binary file added cogs/__pycache__/cookoff.cpython-313.pyc
Binary file not shown.
Binary file added cogs/__pycache__/dev.cpython-313.pyc
Binary file not shown.
Binary file added cogs/__pycache__/help.cpython-313.pyc
Binary file not shown.
Binary file added cogs/__pycache__/shop.cpython-313.pyc
Binary file not shown.
Binary file added cogs/__pycache__/tasks.cpython-313.pyc
Binary file not shown.
Binary file added cogs/__pycache__/tempcook.cpython-313.pyc
Binary file not shown.
Binary file added cogs/__pycache__/user.cpython-313.pyc
Binary file not shown.
66 changes: 36 additions & 30 deletions cogs/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from discord.ext import commands

import datetime

import string
import time
import subprocess
import traceback
Expand Down Expand Up @@ -46,7 +46,7 @@ async def run_cmd(self, cmd: str) -> str:
@commands.Cog.listener()
async def on_guild_remove(self, guild):
try:
embed = discord.Embed(colour=0xa82021, description="Please take the time to fill out [this exit form](https://forms.gle/wkMNiSanpnpeLTt88). Thanks for using Restaurant Bot.")
embed = discord.Embed(colour=0x8980d9, description="Please take the time to fill out [this exit form](https://forms.gle/wkMNiSanpnpeLTt88). Thanks for using Bistro Bot.")
embed.set_author(name="Goodbye!")
await self.bot.get_user(guild.owner.id).send(embed=embed)
except:
Expand Down Expand Up @@ -78,9 +78,9 @@ async def pull(self, ctx):
async def ban(self, ctx, id:int, *, reason):
if ctx.author.id == 396153668820402197:
user = self.bot.get_user(id)
await ctx.send(f"**{user}** was banned from using Restaurant.")
await ctx.send(f"**{user}** was banned from using Bistro.")
db.utility.update_one({"utility": "banlist"}, {"$push":{"banned": user.id}})
embed = discord.Embed(colour=0xa82021, description=f"You were banned from using **Restaurant**. Reason: `{reason}`\n\nIf you would like to appeal, visit http://paixlukee.ml/restaurant/appeal.html.")
embed = discord.Embed(colour=0x8980d9, description=f"You were banned from using **Bistro**. Reason: `{reason}`\n\nIf you would like to appeal, visit http://paixlukee.ml/restaurant/appeal.html.")
embed.set_image(url="http://paixlukee.ml/m/6UK4U.jpg")
await user.send(embed=embed)
else:
Expand All @@ -90,11 +90,11 @@ async def ban(self, ctx, id:int, *, reason):
async def shell(self, ctx, *, code):
if ctx.author.id == 396153668820402197:
embed = discord.Embed(description=f"```css\nConnecting to shell..```")
embed.set_author(name="Please Wait.", icon_url=self.bot.user.avatar_url)
embed.set_author(name="Please Wait.", icon_url=ctx.me.avatar.with_format('png'))
msg = await ctx.send(embed=embed)
shell = await self.run_cmd(code)
embed = discord.Embed(description=f"```css\n{shell}```")
embed.set_author(name="Shell", icon_url=self.bot.user.avatar_url)
embed.set_author(name="Shell", icon_url=ctx.me.avatar.with_format('png'))
await msg.delete()
await ctx.send(embed=embed)
else:
Expand All @@ -103,14 +103,13 @@ async def shell(self, ctx, *, code):

@commands.command(pass_context=True)
async def ping(self, ctx):
"""Get Res's Ping"""
t1 = time.perf_counter()
await ctx.trigger_typing()
await ctx.typing()
t2 = time.perf_counter()
ping = str(round((t2-t1)*1000))
ol = round(ctx.bot.latencies[0][1]*1000)
sl = round(ctx.bot.latencies[1][1]*1000)
tl = round(ctx.bot.latencies[2][1]*1000)
ol = round(ctx.bot.latency * 1000)
sl = round(ctx.bot.latency * 1000)
tl = round(ctx.bot.latency * 1000)
if ol >= 90:
oe = '<:idle:701016198531383316>'
else:
Expand All @@ -126,9 +125,9 @@ async def ping(self, ctx):
oc = await self.get_shard(1)
sc = await self.get_shard(2)
tc = await self.get_shard(3)
shard = ctx.guild.shard_id+1
embed = discord.Embed(colour=0xa82021, description=f"The ping for **{ctx.guild.name}** is `{ping}ms`.")
embed.set_author(name="Pong!", icon_url=ctx.me.avatar_url_as(format='png'))
shard = ctx.guild.shard_id + 1
embed = discord.Embed(colour=0x8980d9, description=f"The ping for **{ctx.guild.name}** is `{ping}ms`.")
embed.set_author(name="Pong!", icon_url=ctx.bot.user.avatar.url)
embed.add_field(name=f"{oe} Shard #1", value=f"`{ol}ms` `{oc} servers`")
embed.add_field(name=f"{se} Shard #2", value=f"`{sl}ms` `{sc} servers`")
embed.add_field(name=f"{te} Shard #3", value=f"`{tl}ms` `{tc} servers`")
Expand All @@ -137,10 +136,11 @@ async def ping(self, ctx):

@commands.command()
async def invite(self, ctx):
await ctx.send("Invite me to your server! <https://discordapp.com/api/oauth2/authorize?client_id=648065060559781889&permissions=10240&scope=bot>")
await ctx.send("Invite me to your server! <https://discord.com/oauth2/authorize?client_id=657037653346222102&permissions=274878180416&integration_type=0&scope=bot>")

@commands.command(hidden=True)
async def load(self, ctx, extension):
print("\nLOAD INIT!\n")
if ctx.author.id == 396153668820402197:
try:
if extension == 'all':
Expand All @@ -150,7 +150,7 @@ async def load(self, ctx, extension):
not_loaded = []
for extension in extensions:
try:
self.bot.load_extension(extension)
await self.bot.load_extension(extension)
loaded.append(f'`{extension}`')
except Exception as error:
not_loaded.append(f'`{extension}` - `{error}`')
Expand All @@ -164,22 +164,22 @@ async def load(self, ctx, extension):
embed.add_field(name='Not Loaded', value=not_loaded)
await ctx.send(embed=embed)
else:
self.bot.load_extension("cogs.{}".format(extension))
embed = discord.Embed(title="<:CheckMark:473276943341453312> Cog loaded:", color=0x5bff69, description="**Cog:** `cogs\{}.py`".format(extension))
await self.bot.load_extension("cogs.{}".format(extension))
embed = discord.Embed(title="Cog loaded:", color=0x5bff69, description="<:CheckMark:473276943341453312> **Cog:** `cogs\\{}.py`".format(extension))
await ctx.send(embed=embed)
print('\n\nCOG LOAD\n--[Cog loaded, {}.py]--\n\n'.format(extension))
except Exception as error:
print('\n\nEXTEN./COG ERROR: {} was not loaded due to an error: \n-- [{}] --\n\n'.format(extension, error))
embed = discord.Embed(title="<:WrongMark:473277055107334144> Error loading cog:", color=0xff775b, description="**Cog:** `cogs\{}.py`\n**Errors:**\n```{}```".format(extension, error))
embed = discord.Embed(title="<:RedTick:653464977788895252> Error loading cog:", color=0xff775b, description="**Cog:** `cogs\\{}.py`\n**Errors:**\n```{}```".format(extension, error))
await ctx.send(embed=embed)
else:
pass

@commands.command(aliases=['un'], hidden=True)
@commands.is_owner()
async def unload(self, ctx, extension):
self.bot.unload_extension("cogs.{}".format(extension))
embed = discord.Embed(title="<:CheckMark:473276943341453312> Cog unloaded:", color=0x5bff69, description="**Cog:** `cogs\{}.py`".format(extension))
await self.bot.unload_extension("cogs.{}".format(extension))
embed = discord.Embed(title="Cog unloaded:", color=0x5bff69, description="<:CheckMark:473276943341453312> **Cog:** `cogs\\{}.py`".format(extension))
print('\x1b[1;32;40m' + '[COG-RELOADED]: ' + '\x1b[0m' + '{} was unloaded successfully'.format(extension))
await ctx.send(embed=embed)

Expand All @@ -188,14 +188,16 @@ async def unload(self, ctx, extension):
async def reload(self, ctx, extension):
if ctx.author.id == 396153668820402197:
try:
self.bot.unload_extension("cogs.{}".format(extension))
self.bot.load_extension("cogs.{}".format(extension))
embed = discord.Embed(title="<:CheckMark:473276943341453312> Cog reloaded:", color=0x5bff69, description="**Cog:** `cogs\{}.py`".format(extension))
await ctx.typing()
await self.bot.unload_extension("cogs.{}".format(extension))
await asyncio.sleep(1)
await self.bot.load_extension("cogs.{}".format(extension))
embed = discord.Embed(title="Cog reloaded:", color=0x5bff69, description="<:CheckMark:473276943341453312> **Cog:** `cogs\\{}.py`".format(extension))
await ctx.send(embed=embed)
print('\x1b[1;32;40m' + '[COG-RELOADED]: ' + '\x1b[0m' + '{} was reloaded successfully'.format(extension))
except Exception as error:
print('\x1b[1;31;40m' + '[COG-RELOAD-ERROR]: ' + '\x1b[0m' + '{} was not reloaded due to an error: {} '.format(extension, error))
embed = discord.Embed(title="<:WrongMark:473277055107334144> Error reloading cog:", color=0xff775b, description="**Cog:** `cogs\{}.py`\n**Errors:**\n```{}```".format(extension, error))
embed = discord.Embed(title="<:RedTick:653464977788895252> Error reloading cog:", color=0xff775b, description="**Cog:** `cogs\\{}.py`\n**Errors:**\n```{}```".format(extension, error))
await ctx.send(embed=embed)
else:
pass
Expand All @@ -216,17 +218,19 @@ async def on_command_error(self, ctx, error): # <:RedTick:653464977788895252>
await ctx.send(f"<:RedTick:653464977788895252> You are on cooldown! Please wait **{hours} {round(minutes)}m {round(seconds)}s**.")

else:
id = ''.join([random.choice(string.digits) if i % 2 == 0 else random.choice(string.ascii_letters) for i in range(7)])
print("\x1b[1;31;40m" + f"[{type(error).__name__}]: " + "\x1b[0m" + str(error))
ig = (asyncio.futures.TimeoutError, commands.CommandNotFound, commands.CommandOnCooldown, discord.Forbidden, commands.NoPrivateMessage, commands.DisabledCommand, commands.CheckFailure, commands.UserInputError)
ig = (TimeoutError, commands.CommandNotFound, commands.CommandOnCooldown, discord.Forbidden, commands.NoPrivateMessage, commands.DisabledCommand, commands.CheckFailure, commands.UserInputError)
error = getattr(error, 'original', error)
if isinstance(error, ig):
return
embed = discord.Embed(colour=0xa82021)
embed.set_author(icon_url=ctx.me.avatar_url_as(format='png'), name="Command Error")
embed = discord.Embed(colour=0xff0000)
embed.set_author(icon_url=ctx.bot.user.avatar.url, name="Command Error")
embed.set_footer(text=f"Type: {type(error).__name__.upper()}")
description = f"**Command**: {ctx.command.qualified_name}\n"\
f"**Author**: {ctx.author} `ID: {ctx.author.id}`\n"\
f"**Channel**: #{ctx.channel} `ID: {ctx.channel.id}`"
f"**Channel**: #{ctx.channel} `ID: {ctx.channel.id}`\n"\
f"**Error ID:** {id}"
if ctx.guild:
description += f'\n**Guild**: {ctx.guild} `ID: {ctx.guild.id}`'
fe = ''.join(traceback.format_exception(type(error), error, error.__traceback__, chain=False))
Expand All @@ -241,6 +245,7 @@ async def on_command_error(self, ctx, error): # <:RedTick:653464977788895252>
pass
try:
await self.bot.get_channel(658708974836645888).send(embed=embed)
await ctx.send(f"<:RedTick:653464977788895252> Error! Please see our [Support Server](https://discord.gg/BCRtw7c) for more information. `Code: {id}`")
except:
pass
if isinstance(error, commands.CommandInvokeError):
Expand All @@ -251,4 +256,5 @@ async def on_command_error(self, ctx, error): # <:RedTick:653464977788895252>


async def setup(bot):
await bot.add_cog(Botdev(bot))
cog = Botdev(bot)
await bot.add_cog(cog)
25 changes: 25 additions & 0 deletions cogs/btn-example.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@


async def button_callback(interaction):
await interaction.response.defer()



button = Button(label="←", custom_id="prev_page", style=discord.ButtonStyle.primary)


d_btn.callback = lambda interaction: t_button_callback(interaction, "d", b)

view = View()
view.add_item(button)

# no args
button.callback = button_callback


if msg:
await food_msg.delete()
try:
await interaction.message.delete()
except:
pass
Loading

0 comments on commit b747614

Please sign in to comment.