!give command now adds people to database 🐛
This commit is contained in:
@ -23,13 +23,16 @@ class GamesCog(commands.Cog):
|
||||
@commands.command()
|
||||
async def give(self, ctx, *, content):
|
||||
commands = content.split(" ")
|
||||
if len(commands) == 2:
|
||||
amount = int(commands[1])
|
||||
response = self.client.money.giveMoney("#"+str(ctx.message.author.id),commands[0],amount)
|
||||
await ctx.send(response)
|
||||
else:
|
||||
logThis("I didn't understand that (error code 1222)",str(ctx.message.channel.id))
|
||||
await ctx.send("I didn't understand that (error code 1222)")
|
||||
amount = int(commands[-1])
|
||||
username = " ".join(commands[:-1])
|
||||
if self.client.funcs.getID(username) == None:
|
||||
async for member in ctx.guild.fetch_members(limit=None):
|
||||
if member.display_name.lower() == username.lower():
|
||||
username = member.display_name
|
||||
userID = "#" + str(member.id)
|
||||
self.client.database["users"].insert_one({"_id":userID,"user name":username,"money":0})
|
||||
response = self.client.money.giveMoney("#"+str(ctx.message.author.id),username,amount)
|
||||
await ctx.send(response)
|
||||
|
||||
# Invest GwendoBucks in the stock market
|
||||
@commands.command(aliases=["i"])
|
||||
|
Reference in New Issue
Block a user