mirror of
https://github.com/TitanEmbeds/Titan.git
synced 2024-12-28 07:57:04 +01:00
Start command update
This commit is contained in:
parent
716b7dd7a5
commit
1a9b3ad452
@ -161,32 +161,32 @@ class Titan(commands.Bot):
|
|||||||
async def ban(ctx, self):
|
async def ban(ctx, self):
|
||||||
message = ctx.message
|
message = ctx.message
|
||||||
if not message.author.server_permissions.ban_members:
|
if not message.author.server_permissions.ban_members:
|
||||||
await self.client.send_message(message.channel, message.author.mention + " I'm sorry, but you do not have permissions to ban guest members.")
|
await self.send_message(message.channel, message.author.mention + " I'm sorry, but you do not have permissions to ban guest members.")
|
||||||
return
|
return
|
||||||
serverid = message.server.id
|
serverid = message.server.id
|
||||||
content = message.content.strip()
|
content = message.content.strip()
|
||||||
if len(content.split()) == 2:
|
if len(content.split()) == 2:
|
||||||
await self.client.send_message(message.channel, message.author.mention + " Please provide a username-query (or optionally a discriminator) to ban a guest user.\nExample: `ban Titan#0001`")
|
await self.send_message(message.channel, message.author.mention + " Please provide a username-query (or optionally a discriminator) to ban a guest user.\nExample: `ban Titan#0001`")
|
||||||
return
|
return
|
||||||
content = content.split()
|
content = content.split()
|
||||||
username = content[2][:content[2].find("#")] if "#" in content[2] else content[2]
|
username = content[2][:content[2].find("#")] if "#" in content[2] else content[2]
|
||||||
discriminator = int(content[2][content[2].find("#") + 1:]) if "#" in content[2] else None
|
discriminator = int(content[2][content[2].find("#") + 1:]) if "#" in content[2] else None
|
||||||
reason = await self.database.ban_unauth_user_by_query(message.server.id, message.author.id, username, discriminator)
|
reason = await self.database.ban_unauth_user_by_query(message.server.id, message.author.id, username, discriminator)
|
||||||
await self.client.send_message(message.channel, message.author.mention + " " + reason)
|
await self.send_message(message.channel, message.author.mention + " " + reason)
|
||||||
|
|
||||||
@bot.command(pass_context=True)
|
@bot.command(pass_context=True)
|
||||||
async def kick(ctx, self):
|
async def kick(ctx, self):
|
||||||
message = ctx.message
|
message = ctx.message
|
||||||
if not message.author.server_permissions.kick_members:
|
if not message.author.server_permissions.kick_members:
|
||||||
await self.client.send_message(message.channel, message.author.mention + " I'm sorry, but you do not have permissions to kick guest members.")
|
await self.send_message(message.channel, message.author.mention + " I'm sorry, but you do not have permissions to kick guest members.")
|
||||||
return
|
return
|
||||||
serverid = message.server.id
|
serverid = message.server.id
|
||||||
content = message.content.strip()
|
content = message.content.strip()
|
||||||
if len(content.split()) == 2:
|
if len(content.split()) == 2:
|
||||||
await self.client.send_message(message.channel, message.author.mention + " Please provide a username-query (or optionally a discriminator) to kick a guest user.\nExample: `kick Titan#0001`")
|
await self.send_message(message.channel, message.author.mention + " Please provide a username-query (or optionally a discriminator) to kick a guest user.\nExample: `kick Titan#0001`")
|
||||||
return
|
return
|
||||||
content = content.split()
|
content = content.split()
|
||||||
username = content[2][:content[2].find("#")] if "#" in content[2] else content[2]
|
username = content[2][:content[2].find("#")] if "#" in content[2] else content[2]
|
||||||
discriminator = int(content[2][content[2].find("#") + 1:]) if "#" in content[2] else None
|
discriminator = int(content[2][content[2].find("#") + 1:]) if "#" in content[2] else None
|
||||||
reason = await self.database.revoke_unauth_user_by_query(message.server.id, username, discriminator)
|
reason = await self.database.revoke_unauth_user_by_query(message.server.id, username, discriminator)
|
||||||
await self.client.send_message(message.channel, message.author.mention + " " + reason)
|
await self.send_message(message.channel, message.author.mention + " " + reason)
|
Loading…
Reference in New Issue
Block a user