Skip to content

Instantly share code, notes, and snippets.

@outout14
Created July 4, 2016 16:27
Show Gist options
  • Save outout14/a769956674207b69cfd88569e062614e to your computer and use it in GitHub Desktop.
Save outout14/a769956674207b69cfd88569e062614e to your computer and use it in GitHub Desktop.
import discord
import asyncio
from msg import *
import gettext
client = discord.Client()
@client.event
##CONSOLE
async def on_ready():
print('Je suis Pomme, un bot de modération :) ')
print('Logged in as')
print(client.user.name)
print(client.user.id)
print('------')
##END CONSOLE
@client.event
async def on_message(message):
##MESSAGES
## OWNER ID ?
efg = ["Créateur","Développeur","Modérateur"]
role = message.author.roles
auteur = role[1]
if message.content.startswith('-help') and str(auteur) in efg: ##INFO
await client.send_message(message.author, helpe)
await client.delete_message(message)
if message.content.startswith('-info') and str(auteur) in efg: ##INFO
await client.send_message(message.author, info)
await client.delete_message(message)
elif message.content.startswith('-getinfo'):
ro = message.author.roles
la = ro[1]
await client.send_message(message.author, getinfo)
await client.delete_message(message)
elif message.content.startswith("-broadcast") and str(auteur) in efg: ##CONTROL
args_ = message.content.split("(")
argument = args_[1]
await client.send_message(message.channel, broadcast_prefix + str(argument))
await client.delete_message(message)
elif message.content.startswith("-control") and str(auteur) in efg: ##CONTROL
args_ = message.content.split("(")
argument = args_[1]
await client.send_message(message.channel, str(argument))
await client.delete_message(message)
elif message.content.startswith("-kick") and str(auteur) in efg: ##KICK
args_ = message.content.split(" ")
argument = args_[2]
member = discord.utils.get(message.server.members, name=str(argument))
await client.kick(member)
await client.send_message(message.author, kick_mp)
await client.send_message(message.channel, kick_msg)
await client.delete_message(message)
elif message.content.startswith("-ban") and str(auteur) in efg: ##BAN
args_ = message.content.split(" ")
argument = args_[2]
member = discord.utils.get(message.server.members, name=str(argument))
await client.ban(member, delete_message_days=1)
await client.send_message(message.author, ban_mp)
await client.send_message(message.channel, ban_msg)
await client.delete_message(message)
elif message.content.startswith("-mute") and str(auteur) in efg: ##KICK
args_ = message.content.split(" ")
argument = args_[2]
member = discord.utils.get(message.server.members, name=str(argument))
await client.server_voice_state(member, mute=True)
await client.send_message(message.channel, '✅ ' + str(argument) + ' à été muté par ' + message.author.mention + ' !')
await client.delete_message(message)
elif message.content.startswith("-unmute") and str(auteur) in efg: ##KICK
args_ = message.content.split(" ")
argument = args_[2]
member = discord.utils.get(message.server.members, name=str(argument))
await client.server_voice_state(member, mute=False)
await client.send_message(message.channel, '✅ ' + str(argument) + ' à été démuté par ' + message.author.mention + ' !')
await client.delete_message(message)
elif message.content.startswith("-demute") and str(auteur) in efg: ##KICK
args_ = message.content.split(" ")
argument = args_[2]
member = discord.utils.get(message.server.members, name=str(argument))
await client.server_voice_state(member, mute=False)
await client.send_message(message.channel, '✅ ' + str(argument) + ' à été démuté par ' + message.author.mention + ' !')
await client.delete_message(message)
client.run('MTk4ODIwNzE0Nzc2NzU2MjI1.ClltuA.seJBaG46WimWnVw6y4ORwmvlnXY') ##INSERER TOKEN ICI !
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment