Skip to content

Instantly share code, notes, and snippets.

@rougeth
Created Aug 1, 2021
Embed
What would you like to do?
Robô da Python Nordeste 2020/2021
import discord
from discord.ext import commands
from decouple import config
DISCORD_TOKEN = config("DISCORD_TOKEN")
bot = commands.Bot(command_prefix="pyne!", intents=discord.Intents.default())
CONFIRMATION_EMOJI = "✅"
AVISO_PALESTRAS = """
⏰ **A próxima palestra já vai começar!** ⏰
Assista em: <{link}>
"""
AVISO_DA_ORG = """
🎙 **Aviso da Organização** 🎙
{message}
"""
@bot.command(name="aviso-palestra")
async def aviso_palestra(
ctx: commands.Context, channel: discord.TextChannel, link: str
):
message = AVISO_PALESTRAS.format(link=link)
await channel.send(content=message)
await ctx.message.add_reaction(CONFIRMATION_EMOJI)
@bot.command()
async def aviso(ctx: commands.Context, channel: discord.TextChannel, message: str):
message = AVISO_DA_ORG.format(message=message)
await channel.send(content=message)
await ctx.message.add_reaction(CONFIRMATION_EMOJI)
if __name__ == "__main__":
bot.run(DISCORD_TOKEN)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment