Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import discord
- import asyncio
- from discord.ext import commands
- from discord import TextChannel
- from discord.ext.commands import Bot
- client = commands.Bot(command_prefix = "/")
- client.remove_command('help')
- @client.event
- async def on_ready():
- await client.change_presence(status = discord.Status.online, activity = discord.Game("Minecraft | kitwars.net"))
- print("--------------------------------------------------------------------------------")
- print("--------------------------------Systems activated!------------------------------")
- print("--------------------------------------------------------------------------------")
- @client.event
- async def on_raw_reaction_add(payload):
- message_id = payload.message_id
- if message_id == 711998947303882835:
- guild_id = payload.guild_id
- guild = discord.utils.find(lambda g : g.id == guild_id, client.guilds)
- if payload.emoji.name == 'INSERT_EMOJI':
- role = discord.utils.get(guild.roles, name='INSERT_ROLE')
- elif payload.emoji.name == 'INSERT_EMOJI':
- role = discord.utils.get(guild.roles, name='INSERT_ROLE')
- else:
- role = discord.utils.get(guild.roles, name=payload.emoji.name)
- if role is not None:
- member = discord.utils.find(lambda m : m.id == payload.user_id, guild.members)
- if member is not None:
- await member.add_roles(role)
- print("Role added.")
- else:
- print("Member not found.")
- else:
- print("Role not found.")
- @client.event
- async def on_raw_reaction_remove(payload):
- message_id = payload.message_id
- if message_id == 711998947303882835:
- guild_id = payload.guild_id
- guild = discord.utils.find(lambda g : g.id == guild_id, client.guilds)
- if payload.emoji.name == 'INSERT_EMOJI':
- role = discord.utils.get(guild.roles, name='INSERT_ROLE')
- elif payload.emoji.name == 'INSERT_EMOJI':
- role = discord.utils.get(guild.roles, name='INSERT_ROLE')
- else:
- role = discord.utils.get(guild.roles, name=payload.emoji.name)
- if role is not None:
- member = discord.utils.find(lambda m : m.id == payload.user_id, guild.members)
- if member is not None:
- await member.remove_roles(role)
- print("Role removed.")
- else:
- print("Member not found.")
- else:
- print("Role not found.")
- @client.command()
- @commands.has_permissions(administrator=True)
- async def a(ctx, channel: TextChannel, *, message):
- await channel.send(message)
- announcement = await ctx.send("Announcement successfully created!")
- await asyncio.sleep(2)
- await announcement.delete()
- @client.command()
- async def ping(ctx):
- embed = discord.Embed(
- title = 'Pong!',
- description = '{}ms' .format(round(client.latency * 1000)),
- color = discord.Color.from_rgb(r=159, g=255, b=255)
- )
- embed.set_footer(text='{}' .format(ctx.author))
- await ctx.send(embed=embed)
- print("Ping command successfully executed!")
- @client.command()
- async def help(ctx):
- embed = discord.Embed(
- title = 'Need help?',
- description = 'No worries, just DM me any questions you have!',
- color = discord.Color.from_rgb(r=159, g=255, b=255)
- )
- embed.set_footer(text='Requested by {} | ID-{}' .format(ctx.author, ctx.author.id))
- await ctx.send(embed=embed)
- print("{} | ID-{} is requesting help!" .format(ctx.author, ctx.author.id))
- @client.command(pass_context=True)
- @commands.has_permissions(manage_messages=True)
- async def clear(ctx, amount=0):
- channel = ctx.message.channel
- messages = []
- async for message in channel.history(limit=amount + 1):
- messages.append(message)
- await channel.delete_messages(messages)
- print("Messages deleted!")
- announcement = await ctx.send('Messages deleted!')
- await asyncio.sleep(2)
- await announcement.delete()
- @client.command()
- @commands.has_permissions(kick_members=True)
- @commands.has_permissions(ban_members=True)
- async def mute(ctx, member : discord.Member):
- guild = ctx.guild
- for role in guild.roles:
- if role.name == "Muted":
- await member.add_roles(role)
- await ctx.send("{} has has been muted!" .format(member.mention))
- @client.command()
- @commands.has_permissions(kick_members=True)
- @commands.has_permissions(ban_members=True)
- async def unmute(ctx, member : discord.Member):
- guild = ctx.guild
- for role in guild.roles:
- if role.name == "Muted":
- await member.remove_roles(role)
- await ctx.send("{} has has been unmuted!" .format(member.mention))
- @client.event
- async def on_message(message):
- channel = client.get_channel(714242239215304745)
- if message.guild is None and message.author != client.user:
- embed = discord.Embed(
- title = 'Support requested!',
- description = '{}' .format(message.content),
- color = discord.Color.from_rgb(r=159, g=255, b=255)
- )
- embed.set_footer(text='Requested by {} | ID-{}' .format(message.author, message.author.id))
- await channel.send(embed=embed)
- print("Support requested by {} | ID-{}!" .format(message.author, message.author.id))
- print("Content: '{}'." .format(message.content))
- await client.process_commands(message)
- @client.event
- async def on_message(message):
- if message.content != "f" and message.channel.id == 699364974014890044:
- await message.delete()
- embed = discord.Embed(
- title = 'Paying respeccs',
- description = 'Please do not abuse your ability to pay respeccs. To pay respecc the correct way, please send `f`. All other messages will be deleted and reviewed by the staff team in the case of offendable messages.',
- color = discord.Color.from_rgb(r=159, g=255, b=255)
- )
- embed.add_field(name="Message content", value="~~_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _~~", inline=False)
- embed.set_footer(text='{} | {} - ID-{}' .format(message.content, message.author, message.author.id))
- await message.author.send(embed=embed)
- print(f"Deleted '{message.content}' on channel #pay-respecc by {message.author}. Warning message has been sent!")
- await client.process_commands(message)
- @client.event
- async def on_message_edit(before, after):
- if after.content != "f" and after.channel.id == 699364974014890044:
- await after.delete()
- embed = discord.Embed(
- title = 'Paying respeccs',
- description = 'Please do not abuse your ability to pay respeccs. To pay respecc the correct way, please send `f`. All other messages will be deleted and reviewed by the staff team in the case of offendable messages.',
- color = discord.Color.from_rgb(r=159, g=255, b=255)
- )
- embed.add_field(name="Message content", value="~~_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _~~", inline=False)
- embed.set_footer(text='{} | {} | ID-{}' .format(after.content, after.author, after.author.id))
- await after.author.send(embed=embed)
- print(f"Deleted '{after.content}' on channel #pay-respecc by {after.author} ID{after.author.id}. Warning message has been sent!")
- await client.process_commands(after)
- client.run("TOKEN")
- bot.run("TOKEN")
Add Comment
Please, Sign In to add comment