Skip to content

Commit

Permalink
Merge pull request #80 from murpii/pr_testing_c
Browse files Browse the repository at this point in the history
testing_c threads
  • Loading branch information
murpii authored Feb 10, 2024
2 parents 824c164 + 834c295 commit 3ee5d63
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
2 changes: 2 additions & 0 deletions bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ async def setup_hook(self):

async def on_ready(self):
log.info('Logged in as %s (ID: %d)', self.user, self.user.id)
synced = await self.tree.sync()
log.info(f"Slash CMDs Synced: {str(len(synced))} Commands")

async def on_resumed(self):
log.info('Resumed')
Expand Down
20 changes: 20 additions & 0 deletions cogs/map_testing/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import discord
from discord.ext import commands, tasks
from discord import app_commands

from cogs.map_testing.log import TestLog
from cogs.map_testing.map_channel import MapChannel, MapState
Expand Down Expand Up @@ -646,6 +647,25 @@ async def archive_imm(self, ctx: commands.Context):
await ctx.message.add_reaction(':oop:395753983379243028')
log.error('Failed archiving channel #%s', map_channel)

@app_commands.command(name='promote', description="Creates a private thread to discuss the promotion")
@app_commands.describe(trial_tester='@mention the trial tester to promote')
async def create_thread(self, interaction: discord.Interaction, trial_tester: discord.Member):
await interaction.response.defer(ephemeral=True, thinking=True) # noqa

channel = interaction.channel

thread = await channel.create_thread(name=f'Promote {trial_tester.global_name}', message=None, invitable=False)
await thread.send(
f'<@&930665860408946708> \n'
f'{interaction.user.mention} suggests to promote {trial_tester.global_name} to Tester. Opinions?'
)

await interaction.followup.send( # noqa
f"<@{interaction.user.id}> your thread has been created: {thread.jump_url}", ephemeral=True)
log.info(f'{interaction.user} (ID: {interaction.user.id}) created a thread in {interaction.channel.name}')

if interaction.response.is_done(): # noqa
return

async def setup(bot: commands.Bot):
await bot.add_cog(MapTesting(bot))

0 comments on commit 3ee5d63

Please sign in to comment.