Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command complete! #5

Merged
merged 1 commit into from
Oct 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1180,6 +1180,29 @@ async def clear_roll(interaction : discord.Interaction, member : discord.Member,
await Mongo_Reader.dump_user(user)
return await interaction.followup.send("Done!")

@tree.command(name='force-add', description="Force add a roll to a user's completed rolls section.", guild=guild)
async def force_add(interaction : discord.Interaction, member : discord.Member, roll_name : hm.ALL_ROLL_EVENT_NAMES) :
await interaction.response.defer()

# log this interaction
private_log_channel = client.get_channel(hm.PRIVATE_LOG_ID)
await private_log_channel.send(f":white_large_square: dev command run by <@{interaction.user.id}>: /force-add, "
+ f"params: member=<@{member.id}>, roll_name={roll_name}",
allowed_mentions=discord.AllowedMentions.none())

# get database user and the user
database_user = await Mongo_Reader.get_mongo_users()
user = Discord_Helper.get_user_by_discord_id(member.id, database_user)

user.add_completed_roll(CERoll(
roll_name=roll_name,
user_ce_id=user.ce_id,
games=None
))

await Mongo_Reader.dump_user(user)
return await interaction.followup.send("Done!")

"""
# _____ ______ _______ _____ ____ _ _ _____ __ __ ______
Expand Down