-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from bentettmar/bentettmar-examples-1
Add embed cmd example.
- Loading branch information
Showing
1 changed file
with
18 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from click import command | ||
import discord_self_embed | ||
from discord.ext import commands | ||
|
||
bot = commands.Bot(command_prefix=".", self_bot=True) | ||
|
||
@bot.event | ||
async def on_ready(): | ||
print("ready") | ||
|
||
@bot.command(name="embed") | ||
async def embed_cmd(ctx): | ||
embed = discord_self_embed.Embed("discord.py-self_embed", description="A way for selfbots to send embeds again.", colour="ff0000", url="https://github.com/bentettmar/discord.py-self_embed") | ||
embed.set_author("Ben Tettmar") | ||
|
||
await ctx.send(embed.generate_url(hide_url=True)) # You can also send the embed converted to a string which will auto hide the url. | ||
|
||
bot.run("TOKEN_HERE") |