Skip to content

Instantly share code, notes, and snippets.

@ThatOneCalculator
Last active February 28, 2022 17:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ThatOneCalculator/c5b56f57002765ac20e1404c51c0fe0a to your computer and use it in GitHub Desktop.
Save ThatOneCalculator/c5b56f57002765ac20e1404c51c0fe0a to your computer and use it in GitHub Desktop.
Bot for Ukraine War Reports
import disnake
from disnake.ext import commands
bot = commands.Bot(
command_prefix=commands.when_mentioned_or("!!"),
description="Bot for Ukraine War Reports",
intents=disnake.Intents.default(),
chunk_guilds_at_startup=True)
@bot.event
async def on_message(message):
await bot.wait_until_ready()
if message.author.bot:
return
if message.channel.category_id == 946260227181932615: # Non verified sources category
if message.content.find("http") != -1 or len(message.attachments) > 0:
[await message.add_reaction(i) for i in ["👍", "👎"]]
try:
await message.create_thread(name=f"{message.author.name}'s thread")
except:
pass
else:
await message.delete()
@bot.slash_command()
async def source_code(inter: disnake.ApplicationCommandInteraction):
"""Shows bot source code"""
await inter.send("https://gist.github.com/ThatOneCalculator/c5b56f57002765ac20e1404c51c0fe0a")
bot.run("TOKEN")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment