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 (Part 2) ✨
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin O'Brien committed Aug 7, 2020
1 parent 0883884 commit b204f54
Show file tree
Hide file tree
Showing 6 changed files with 126 additions and 5 deletions.
16 changes: 15 additions & 1 deletion commands/currency/buy.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,21 @@ async def purchase(self, ctx, id, amount):

return await ctx.send(embed = Tools.error("You need premium to purchase that."))

elif "banklock" in item["tags"]:
elif ":" in item["name"]:

if ">" in item["name"]:

item["name"] = item["name"].split(">")[1]

else:

item["name"] = item["name"].split(":")[2]

if item["name"].startswith(" "):

item["name"] = item["name"][1:]

if "banklock" in item["tags"]:

if amount > 1:

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

# Modules
import discord
from json import loads, dumps

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

# Main Command Class
class Premium(commands.Cog):

def __init__(self, bot):
self.bot = bot
self.desc = "Maybe this is where you get premium"
self.usage = "premium"

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

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

if not Tools.has_flag(db, ctx.author, "premium"):

if ctx.author in self.bot.get_guild(729513002302177311).members:

db[str(ctx.author.id)]["balance"] += 10000

db[str(ctx.author.id)]["data"]["tags"].append("premium")

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

embed = discord.Embed(title = "You have redeemed Prism Premium!", description = "You have gained 10k coins and have a premium badge on your profile.", color = 0x0ee323)

return await ctx.send(embed = embed)

has_premium = True if Tools.has_flag(db, ctx.author, "premium") else False

embed = discord.Embed(title = "Prism Premium :medal:", description = f"Bragging rights for everbody :)\nPremium status: {has_premium}", color = 0x126bf1)

embed.add_field(name = "Benefits", value = ":medal: Exclusive badge on your profile\n:moneybag: Payout of 10k daily coins\n:man_scientist: Access to expirimental commands\n:name_badge: Access to premium-only commands\n:man_artist: Future access to the character customizer", inline = False)

embed.add_field(name = "How to get premium", value = "Prism will never be a paid-for bot; which means premium is\ncompletely free.\n\nTo get premium follow these steps:\n1. Join `discord.gg/KhvXWTr`.\n2. Reuse the `premium` command.\n3. Tada, Prism should let you redeem premium. :D", inline = False)

embed.set_author(name = " | Premium", 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)

# Link to bot
def setup(bot):
bot.add_cog(Premium(bot))
51 changes: 51 additions & 0 deletions commands/entertainment/fakeban.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Prism Rewrite - Basic Command

# Modules
import discord
from assets.prism import Tools

from discord.ext import commands

# Main Command Class
class Fakeban(commands.Cog):

def __init__(self, bot):
self.bot = bot
self.desc = "Bans a member on the server"
self.usage = " ban [user] [reason]"

@commands.command()
@commands.has_permissions(ban_members = True)
async def bban(self, ctx, user: discord.Member = None, *, reason: str = None):

if not user:

return await ctx.send(embed = Tools.error("Please specify a user to ban."))

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

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

elif user.id == self.bot.user.id:

await ctx.send("If that's what you really want, then aight.")

return await ctx.guild.leave()

if reason:

if len(reason) > 512:

return await ctx.send(embed = Tools.error("You can't have a reason over 512 characters."))

embed = discord.Embed(title = f"{ctx.author.name} just banned {user.name} from the server.", description = reason, color = 0x126bf1)

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

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

return await ctx.send(embed = embed)

# Link to bot
def setup(bot):
bot.add_cog(Fakeban(bot))
4 changes: 4 additions & 0 deletions commands/entertainment/hotdog.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ async def hotdog(self, ctx, user = None):

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

if not str(user.id) in db:

return await ctx.send(embed = Tools.error("Yea they don't have an account lmao"))

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

__user = db[str(user.id)]
Expand Down
3 changes: 1 addition & 2 deletions commands/misc/changelog.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ def __init__(self, bot):
@commands.command(aliases = ["version", "cl", "updates", "update"])
async def changelog(self, ctx):

latest_update = json.loads(open("assets/res/update.txt",
"r").read())
latest_update = json.loads(open("assets/res/plain-text/update.txt", "r").read())

if ctx.author in self.bot.get_guild(729513002302177311).members:

Expand Down
4 changes: 2 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Prism Discord Bot - Rewrite Edition
# The only bot you will ever need.

# Last revision: June 12th, 2020.
# Last revision: August 7th, 2020.
# Copyright 2020-20xx MIT; Benjamin O'Brien.


Expand Down Expand Up @@ -49,7 +49,7 @@ async def on_message(msg):

if await Events.on_message(msg) != True:

return
return

return await bot.process_commands(msg)

Expand Down

0 comments on commit b204f54

Please sign in to comment.