Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import discord
- from discord.ext import commands
- from discord.ext import tasks
- import random
- client = discord.Client
- bot = commands.Bot(command_prefix='.')
- @bot.event
- async def on_ready():
- await bot.change_presence(status=discord.Status.idle, activity=discord.Game('beeing useul bot'))
- print("bot is ready")
- @bot.command()
- async def clear(ctx,amount=5):
- await ctx.channel.purge(limit=amount)
- @bot.command()
- async def kick(ctx, member : discord.Member, *, reason=None):
- await member.kick(reason=reason)
- @bot.command()
- async def ban(ctx, member : discord.Member, *, reason=None):
- await member.ban(reason=reason)
- await ctx.send(f'unbanned {member.mention}')
- @bot.command()
- async def unban(ctx, *, member ):
- banned_users = await ctx.guild.bans()
- member_name, member_discriminator = member.split('#')
- for ban_entry in banned_users:
- user = ban_entry.user
- if (user.name, user.discriminator) == (member_name, member_discriminator):
- await ctx.guild.unban(user)
- await ctx.send(f'unbanned {user.mention}')
- return
- @bot.command()
- async def ping(ctx):
- await ctx.send(f'pong! {round(bot.latency * 1000)}ms')
- @bot.command()
- async def subtokb(ctx):
- await ctx.send(f'https://www.youtube.com/channel/UCjvsW1TlOZieLeuHrUUT3JA')
- @bot.command(aliases=['8ball'])
- async def _8ball(ctx, *, question):
- responses = [
- "It is certain.",
- "It is decidedly so.",
- "Without a doubt.",
- "Yes - definitely.",
- "You may rely on it.",
- "As I see it, yes.",
- "Most likely.",
- "Outlook good.",
- "Yes.",
- "Signs point to yes.",
- "Reply hazy, try again.",
- "Ask again later.",
- "Better not tell you now.",
- "Cannot predict now.",
- "Concentrate and ask again.",
- "Don't count on it.",
- "My reply is no.",
- "My sources say no.",
- "Outlook not so good.",
- "Very doubtful."]
- await ctx.send(f'Question: {question}\nAnswer: {random.choice(responses)}')
- @bot.event
- async def on_ready():
- print("bot is ready")
- @bot.event
- async def on_member_join(member):
- print(f'{member} has joined he sever.')
- @bot.event
- async def on_member_remove(member):
- print(f'{member} has left hm sever')
- bot.run("123")
Advertisement
Add Comment
Please, Sign In to add comment