Skip to content

Instantly share code, notes, and snippets.

@4gboframram
Created April 13, 2021 21:11
Show Gist options
  • Save 4gboframram/76b742242e2db51b2c130a71765a1d83 to your computer and use it in GitHub Desktop.
Save 4gboframram/76b742242e2db51b2c130a71765a1d83 to your computer and use it in GitHub Desktop.
Just a little thing you can use to send embeds with discord.py. Not all functionality is here, but maybe I'll add more
import discord
from discord.ext import commands
TOKEN="lmao not leaking my token again"
client=discord.Client()
bot = commands.Bot(command_prefix='-')
title=''
author=''
author_icon=''
description=''
footer=''
color=''
@client.event
async def on_ready():
print(f'{client.user.name} has connected to scord!')
@client.event
async def on_message(message):
if message.author!=client.user:
return
if message.content.startswith("-embed"):
splitMessage=message.content[7:]
splitMessage=splitMessage.split("| ")
print(splitMessage)
await message.delete()
if "title=" in splitMessage[0]:
global title
title=splitMessage[0].split('title=')[1]
print(title)
if "author=" in splitMessage[1]:
global author
author=splitMessage[1].split('author=')[1]
print(author)
if "description=" in splitMessage[2]:
global description
description=splitMessage[2].split('description=')[1]
print(description)
if "color=" in splitMessage[3]:
global color
color=splitMessage[3].split('color=')[1]
print(color)
else: color='0000'
if 'footer=' in splitMessage[4]:
global footer
footer=splitMessage[4].split('footer=')[1]
else: footer=None
embed=discord.Embed(title=title, description=description, color=int('0x'+color,16))
if author!="None" or author!="none": embed.set_author(name=author)
if footer!=None: embed.set_footer(text=footer)
await message.channel.send(embed=embed)
client.run(TOKEN, bot=False)
@4gboframram
Copy link
Author

ew != None

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment