Skip to content

Commit

Permalink
Remove update message
Browse files Browse the repository at this point in the history
  • Loading branch information
thijsmie committed Nov 28, 2023
1 parent 1db5346 commit 8bfea67
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 61 deletions.
53 changes: 0 additions & 53 deletions src/rollbot/bot/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,56 +72,3 @@ async def on_guild_join(guild):
return
logging.error("Could not say hello to {} sadly... :(".format(guild.name))


async def update_server(channel):
if channel and channel.permissions_for(channel.guild.me).send_messages:
try:
await channel.send(
embed=discord.Embed(
title="Thank you for using roll-bot!",
type="rich",
description=text.welcome_text.strip(),
)
)
logging.warning("Said hello to {}!".format(channel.guild.name))
return True
except Exception:
return False
return False


@bot.event
async def on_message(message):
# we do not want the bot to reply to itself
if message.author == bot.user:
return

# we don't want the bot to reply to other bots
if message.author.bot:
return

# we don't care here about messages not associated to a guild
if message.guild is None:
return

UPDATE_LVL = 1
env = var_env_provider.get("__internal__")
update_level = int(env.get(f"GuildULVL[{message.guild.id}]") or "0")

if update_level >= UPDATE_LVL:
return

try:
if message.content.startswith("="):
await message.channel.send(
embed=discord.Embed(
title="Rollbot has updated!",
type="rich",
description=text.update_text.strip(),
)
)
env.set(f"GuildULVL[{message.guild.id}]", str(UPDATE_LVL))
var_env_provider.update(env)
except: # noqa: E722
# We don't care if message.content is gone now
pass
8 changes: 0 additions & 8 deletions src/rollbot/bot/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,6 @@
"""


update_text = """
Rollbot has migrated to discord slash commands. The old message
intents in discord will no longer work, see [here](https://discord.com/blog/slash-commands-are-here).
Use /roll from now on. This message will only be shown once.
You might need to re-invite the bot to get the slash commands to work. You can do that [here](https://discord.com/api/oauth2/authorize?client_id=712234733542572063&permissions=2147534848&scope=bot%20applications.commands).
"""


welcome_text = """
Rollbot supports Discord slash commands. Use /roll and /distribution to roll dice.
If you need any help, check out [the website](https://tmiedema.com/rollbot)! You can find a
Expand Down

0 comments on commit 8bfea67

Please sign in to comment.