Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

Commit

Permalink
🩹 Prism 1.3 Patch 🩹
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin O'Brien committed Aug 23, 2020
1 parent fcddab8 commit baeca8f
Show file tree
Hide file tree
Showing 64 changed files with 67 additions and 339 deletions.
10 changes: 8 additions & 2 deletions assets/prism.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ async def error_handler(ctx, error):

pass

elif "NoSuchUser" in str(error):

return

await ctx.send(embed = discord.Embed(title = "Unexpected Error", description = "The command you just used generated an unexpected error.\nPrism has sent an automatic bug report about this problem.\n\nIn the meantime, try some of our other commands. :)", color = 0xFF0000))

base = ctx.message.content.split(" ")[0] if " " in ctx.message.content else ctx.message.content
Expand Down Expand Up @@ -408,7 +412,7 @@ def bought(name, amount):

return embed

def getClosestUser(ctx, user, return_member = False):
async def getClosestUser(ctx, user, return_member = False):

if ctx.author.id == user.id:

Expand Down Expand Up @@ -460,7 +464,9 @@ def getClosestUser(ctx, user, return_member = False):

if not matches:

return await ctx.send(embed = Tools.error("Couldn't find that user."))
await ctx.send(embed = Tools.error("Couldn't find that user."))

raise AttributeError("NoSuchUser")

id = int(max(matches.items(), key = itemgetter(1))[0])

Expand Down
4 changes: 0 additions & 4 deletions assets/res/plain-text/update.txt

This file was deleted.

14 changes: 3 additions & 11 deletions commands/currency/balance.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,11 @@ async def balance(self, ctx, user: str = None):

db = loads(open("db/users", "r").read())

if not user:

user = ctx.author.name + "#" + str(ctx.author.discriminator)

user = Tools.getClosestUser(ctx, user)

if not user:

return await ctx.send(embed = Tools.error(f"I couldn't find that user; try again with more letters."))
user = await Tools.getClosestUser(ctx, user if user else ctx.author)

elif not str(user.id) in db:
if not str(user.id) in db:

return await ctx.send(embed = Tools.error(f"{user.name} doesn't have an account."))
return await ctx.send(embed = Tools.error(f"{user.name} doesn't have a Prism account."))

_user = db[str(user.id)]

Expand Down
2 changes: 0 additions & 2 deletions commands/currency/bank.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Prism Rewrite - Basic Command

# Modules
import discord
from json import loads, dumps
Expand Down
6 changes: 1 addition & 5 deletions commands/currency/beg.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,7 @@ async def beg(self, ctx, member: str = None):

if member:

member = Tools.getClosestUser(ctx, member)

if not member:

return await ctx.send(embed = Tools.error(f"I couldn't find that user; try again with more letters."))
member = await Tools.getClosestUser(ctx, member)

user = member.name

Expand Down
2 changes: 0 additions & 2 deletions commands/currency/bet.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Prism Rewrite - Basic Command

# Modules
import discord
from random import randint
Expand Down
2 changes: 0 additions & 2 deletions commands/currency/buy.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Prism Rewrite - Basic Command

# Modules
from asyncio import sleep
from json import loads, dumps
Expand Down
2 changes: 0 additions & 2 deletions commands/currency/daily.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Prism Rewrite - Basic Command

# Modules
import discord
from json import loads, dumps
Expand Down
2 changes: 0 additions & 2 deletions commands/currency/deposit.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Prism Rewrite - Basic Command

# Modules
import discord
from json import loads, dumps
Expand Down
11 changes: 1 addition & 10 deletions commands/currency/inventory.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,7 @@ def __init__(self, bot):
@commands.command(aliases = ["inv"])
async def inventory(self, ctx, user = None):

if not user:

user = ctx.author.name + "#" + str(ctx.author.discriminator)

user = Tools.getClosestUser(ctx, user)

if not user:

return await ctx.send(embed = Tools.error(f"I couldn't find that user; try again with more letters."))

user = await Tools.getClosestUser(ctx, user if user else ctx.author)

db = loads(open("db/users", "r").read())

Expand Down
2 changes: 0 additions & 2 deletions commands/currency/lottery.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Prism Rewrite - Basic Command

# Modules
import discord
from random import randint
Expand Down
6 changes: 1 addition & 5 deletions commands/currency/pay.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,7 @@ async def pay(self, ctx, user = None, amount = None):

user = Tools.getClosestUser(ctx, user)

if not user:

return await ctx.send(embed = Tools.error(f"I couldn't find that user; try again with more letters."))

elif user.id == ctx.author.id:
if user.id == ctx.author.id:

return await ctx.send(embed = Tools.error("No paying yourself. >:C"))

Expand Down
2 changes: 1 addition & 1 deletion commands/currency/premium.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def __init__(self, bot):
self.usage = "premium"

@commands.command(aliases = ["upgrade"])
async def premium(self, ctx, *, sentence: str = None):
async def premium(self, ctx):

db = loads(open("db/users", "r").read())

Expand Down
10 changes: 2 additions & 8 deletions commands/currency/rob.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Prism Rewrite - Basic Command

# Modules
import random
import discord
Expand Down Expand Up @@ -28,13 +26,9 @@ async def rob(self, ctx, user = None):

return await ctx.send(embed = Tools.error("Please specify somebody to rob."))

user = Tools.getClosestUser(ctx, user)

if not user:

return await ctx.send(embed = Tools.error(f"I couldn't find that user; try again with more letters."))
user = await Tools.getClosestUser(ctx, user)

elif user.id == ctx.author.id:
if user.id == ctx.author.id:

return await ctx.send(embed = Tools.error("Stop trying to rob yourself."))

Expand Down
2 changes: 0 additions & 2 deletions commands/currency/shop.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Prism Rewrite - Basic Command

# Modules
import discord
from json import loads
Expand Down
10 changes: 2 additions & 8 deletions commands/currency/sock.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Prism Rewrite - Basic Command

# Modules
import discord
from random import randint
Expand All @@ -18,22 +16,18 @@ def __init__(self, bot):
self.usage = "sock [user]"

@commands.command()
async def sock(self, ctx, user: str = None):
async def sock(self, ctx, user = None):

if Cooldowns.on_cooldown(ctx, "sock"):

return await ctx.send(embed = Cooldowns.cooldown_text(ctx, "sock"))

elif not user:

return await ctx.send(embed = Tools.error("I need to know who your trying to sock."))
return await ctx.send(embed = Tools.error("No user specified to sock."))

user = Tools.getClosestUser(ctx, user)

if not user:

return await ctx.send(embed = Tools.error(f"I couldn't find that user; try again with more letters."))

db = loads(open("db/users", "r").read())

if user.id == ctx.author.id:
Expand Down
2 changes: 0 additions & 2 deletions commands/currency/withdraw.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Prism Rewrite - Basic Command

# Modules
import discord
from json import loads, dumps
Expand Down
2 changes: 0 additions & 2 deletions commands/currency/work.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Prism Rewrite - Basic Command

# Modules
import discord
from json import loads, dumps
Expand Down
2 changes: 0 additions & 2 deletions commands/entertainment/sue.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Prism Rewrite - Basic Command

# Modules
import discord
from random import randint
Expand Down
2 changes: 0 additions & 2 deletions commands/entertainment/sun.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Prism Rewrite - Basic Command

# Modules
import discord
from random import choice
Expand Down
2 changes: 0 additions & 2 deletions commands/entertainment/trigger.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Prism Rewrite - Basic Command

# Modules
import discord
from json import loads, dumps
Expand Down
8 changes: 3 additions & 5 deletions commands/entertainment/tts.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Prism Rewrite - Basic Command

# Modules
from assets.prism import Tools
from discord.ext import commands

# Main Command Class
Expand All @@ -10,22 +9,21 @@ def __init__(self, bot):
self.bot = bot
self.desc = "Make the bot speak"
self.usage = "tts [text]"
self.tags = []

@commands.command(aliases = ["text2speech", "texttospeech", "speak", "speech"])
async def tts(self, ctx, *, sentence: str = None):

if not sentence:

return await ctx.send("I can't speak if you don't give me anything to say. >:C")
return await ctx.send(embed = Tools.error("No text specified."))

try:

return await ctx.send(sentence, tts = True)

except:

return await ctx.send("I don't have permission to send TTS messages.")
return await ctx.send(embed = Tools.error("Missing permissions to send TTS messages."))

# Link to bot
def setup(bot):
Expand Down
2 changes: 0 additions & 2 deletions commands/entertainment/unicorn.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Prism Rewrite - Basic Command

# Modules
import discord
from json import loads
Expand Down
56 changes: 1 addition & 55 deletions commands/entertainment/use.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Prism Rewrite - Basic Command

# Modules
import discord
from random import randint
Expand All @@ -24,59 +22,7 @@ async def use(self, ctx, item: str = None):

return await ctx.send(embed = Tools.error("No item specified to use."))

return await ctx.send("wip")

user = Tools.getClosestUser(ctx, user)

if not user:

return await ctx.send(embed = Tools.error("Yea I don't think that's an actual person."))

db = loads(open("db/users", "r").read())

_user = db[str(ctx.author.id)]

__user = db[str(user.id)]

inventory = _user["data"]["inventory"]

if not "Hotdog" in inventory:

return await ctx.send(embed = Tools.error("You don't have any hotdogs! Buy some with the ``shop`` command."))

inventory["Hotdog"]["count"] -= 1

if inventory["Hotdog"]["count"] == 0:

inventory.pop("Hotdog")

if randint(1, 2) == 1:

amt = randint(100, 1000)

_user["balance"] += amt

__user["balance"] -= amt

else:

amt = None

open("db/users", "w").write(dumps(db, indent = 4))

if amt:

embed = discord.Embed(title = f"You just threw your hotdog at {user.name}!", description = f"They dropped {amt} coins!", color = 0x126bf1)

else:

embed = discord.Embed(title = "Woops! Your hotdog missed! oh no :(", color = 0x126bf1)

embed.set_author(name = " | Hotdog", icon_url = self.bot.user.avatar_url)

embed.set_footer(text = f" | Requested by {ctx.author}.", icon_url = ctx.author.avatar_url)

return await ctx.send(embed = embed)
return await ctx.send(embed = Tools.error("This command is coming in `v1.4`."))

# Link to bot
def setup(bot):
Expand Down
2 changes: 0 additions & 2 deletions commands/entertainment/weirdtext.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Prism Rewrite - Basic Command

# Modules
import random

Expand Down
4 changes: 1 addition & 3 deletions commands/misc/bio.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Prism Rewrite - Basic Command

# Modules
import json
import discord
Expand All @@ -24,7 +22,7 @@ async def biography(self, ctx, *, bio: str = None):

elif len(bio) > 200:

return await ctx.send(embed = Tools.error("Your biography is way too long."))
return await ctx.send(embed = Tools.error("You're biography is way too long."))

db = json.loads(open("db/users", "r").read())

Expand Down
32 changes: 0 additions & 32 deletions commands/misc/changelog.py

This file was deleted.

Loading

0 comments on commit baeca8f

Please sign in to comment.