Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import discord
- from discord.ext import commands
- client = commands.Bot(command_prefix = 't.')
- client.remove_command('help')
- @client.event
- async def on_ready():
- await client.change_presence(game=discord.Game(name='Test'))
- print("Bot is ready")
- @client.command()
- async def ping():
- await client.say('Pong!')
- @client.command()
- async def say(*args):
- output = ''
- for word in args:
- output += word
- output += ' '
- await client.say(output)
- @client.command(pass_context=True)
- async def clear(ctx, amount=100):
- channel = ctx.message.channel
- messages = []
- async for message in client.logs_from(channel, limit=int(amount)):
- messages.append(message)
- await client.delete_messages(messages)
- await client.say('I deleted the messages!')
- @client.command(pass_context=True)
- async def joinchannel(ctx):
- channel = ctx.message.author.voice_channel
- await client.join_voice_channel(channel)
- @client.command(pass_context=True)
- async def leavechannel(ctx):
- server = ctx.message.server
- voice_client = client.voice_client_in(server)
- await voice_client.disconnect()
- @client.command(pass_context=True)
- async def help(ctx):
- author = ctx.message.author
- embed = discord.Embed(
- color = discord.Color.green()
- )
- embed.set_author(name='Commands')
- embed.add_field(name='t.help', value='Shows the commands!', inline=False)
- embed.add_field(name='t.ping', value='Responds with Pong!', inline=False)
- await client.send_message(author, embed=embed)
- client.run('NTEzNjcyOTkzNTcxMDc4MTQ0.DtMgHw.kp20ut_NqmdVy4nVwS_BpauYc9Q')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement