1from discord_webhook import DiscordWebhook, DiscordEmbed
2
3webhook = DiscordWebhook(url='your webhook url', username="New Webhook Username")
4
5embed = DiscordEmbed(title='Embed Title', description='Your Embed Description', color='03b2f8')
6embed.set_author(name='Author Name', url='https://github.com/lovvskillz', icon_url='https://avatars0.githubusercontent.com/u/14542790')
7embed.set_footer(text='Embed Footer Text')
8embed.set_timestamp()
9embed.add_embed_field(name='Field 1', value='Lorem ipsum')
10embed.add_embed_field(name='Field 2', value='dolor sit')
11embed.add_embed_field(name='Field 3', value='amet consetetur')
12embed.add_embed_field(name='Field 4', value='sadipscing elitr')
13
14webhook.add_embed(embed)
15response = webhook.execute()
16
1import discord
2from discord.ext import commands
3client = commands.Bot(command_prefix='!!') # This sets the prefix change if you want
4
5TOKEN = 'insert token here' # tutorial at the bottom
6
7@client.event
8def on_ready():
9 print('Ready. Logged in as: {0.user}'.format(client)) # lets you know the bot is online and ready
10
11
12# Now to see how to send a message to discord itself
13@client.command(brief='Echoes back what user says.')
14async def echo(ctx, *, user_message):
15 # The ctx is so that we can send the message on discord
16 # The astrix is so we can take multiple strings for the user message
17 # The string is the users message
18 await ctx.send('User said --> ' + user_message)
19
20client.run(TOKEN)
21
22# Now you can do any command you would like
23# Using the ctx argument.
24
25# HOW TO GET BOT TOKEN
26# To get your bot's token simply go to:
27# https://discord.com/developers/applications
28# Login, and press new application (If you already have a bot skip this part)
29# Press bot, and press yes you want to make it a bot
30# Under token you will see copy, or regenerate
31# Press copy and give the TOKEN variable the value of your token
32