Skip to content

Instantly share code, notes, and snippets.

@rougeth
Created August 1, 2021 18:54
Show Gist options
  • Save rougeth/a7a8fee6e50d75bc0856df1f92f45d8d to your computer and use it in GitHub Desktop.
Save rougeth/a7a8fee6e50d75bc0856df1f92f45d8d to your computer and use it in GitHub Desktop.
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