Skip to content

Commit

Permalink
Merge pull request #227 from Bot-detector/develop
Browse files Browse the repository at this point in the history
 Add descriptions to rsnlinkingCommands, update PM text
  • Loading branch information
extreme4all authored Jul 16, 2024
2 parents d101845 + 2f8d6e3 commit 55946f6
Showing 1 changed file with 20 additions and 7 deletions.
27 changes: 20 additions & 7 deletions src/cogs/rsn_linking_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ async def unverified_msg(self, name: str) -> discord.Embed:
name="Unverified:", value=f"{name} is Unverified.", inline=False
)
embed.add_field(
name="Next Steps:", value=f"Please type '!link {name}'", inline=False
name="Next Steps:", value=f"Please type '/link {name}'", inline=False
)
embed.set_thumbnail(
url="https://user-images.githubusercontent.com/5789682/117239076-19bb4800-adfc-11eb-94c4-27ff7e1217cc.png"
Expand All @@ -63,7 +63,7 @@ async def install_plugin_msg(self) -> discord.Embed:
)
embed.add_field(
name="Next Steps:",
value=f"Please install the Bot-Detector Plugin on RuneLite if you have not done so.\n\nIf you have the plugin installed, you will need to disable Anonymous Reporting for us to be able to !link your account.",
value=f"Please install the Bot-Detector Plugin on RuneLite if you have not done so.\n\nIf you have the plugin installed, you will need to disable Anonymous Reporting for us to be able to /link your account.",
inline=False,
)
embed.set_thumbnail(
Expand Down Expand Up @@ -94,9 +94,9 @@ async def link_msg(self, name, code) -> discord.Embed:
2. Login as: '{name}'
3. Join the clan channel: 'Bot Detector'.
4. Verify that a Plugin Admin or Plugin Moderator is present in the channel.
5. If a Plugin Admin or Plugin Moderator is not available, please leave a message in #bot-detector-commands.
5. If a Plugin Admin or Plugin Moderator is not available, please leave a message in #detector-commands, or create a ticket in #support
6. Type into the Clan Chat: '!Code {code}'.
7. Type '!verify {name}' in #bot-detector-commands channel to confirm that you have been Verified.
7. Type '/verify {name}' in #detector-commands channel to confirm that you have been Verified.
8. Verification Process Complete.
"""
),
Expand All @@ -118,7 +118,7 @@ async def link_msg(self, name, code) -> discord.Embed:
value=cleandoc(
f"""
Do not delete this message.
1. If this RSN was submitted in error, please type '!link <Your Correct RSN>'.
1. If this RSN was submitted in error, please type '/link <Your Correct RSN>'.
2. This code will not expire, it is tied to your unique RSN:Discord Pair.
3. If you are unable to become 'Verified' through this process, please contact an administrator for assistance.
"""
Expand All @@ -129,11 +129,16 @@ async def link_msg(self, name, code) -> discord.Embed:

@commands.hybrid_command(name="link")
async def link(self, ctx: Context, *, name: str):
"""
Link an RSN (Runescape user name) to your Discord account. You must have PMs enabled on Discord.
:param name: RSN you'd wish to link
"""
logger.debug(f"{ctx.author.name=}, {ctx.author.id=}, Requesting link, {name=}")
# check if a name is given
if not name:
await ctx.reply(
"Please specify the RSN of the account you'd wish to link. !link <RSN>"
"Please specify the RSN of the account you'd wish to link. /link <RSN>"
)
return
# check if the name is valid
Expand Down Expand Up @@ -184,6 +189,11 @@ async def link(self, ctx: Context, *, name: str):

@commands.hybrid_command(name="verify")
async def verify(self, ctx: Context, name: str):
"""
Check if an RSN has been linked to a Discord user and verified in-game by a Plugin Admin or Plugin Moderator.
:param name: RSN you wish to check is verified
"""
logger.debug(
f"{ctx.author.name=}, {ctx.author.id=}, Requesting verify, {name=}"
)
Expand Down Expand Up @@ -227,12 +237,15 @@ async def verify(self, ctx: Context, name: str):

@commands.hybrid_command(name="linked")
async def linked(self, ctx: Context):
"""
Lists what RSNs are linked to your Discord account.
"""
logger.debug(f"{ctx.author.name=}, {ctx.author.id=}, Requesting linked")
links = await config.api.get_discord_links(ctx.author.id)

if len(links) == 0:
await ctx.send(
"You do not have any OSRS accounts linked to this Discord ID. Use the !link command in order to link an account."
"You do not have any OSRS accounts linked to this Discord ID. Use the /link command in order to link an account."
)

embeds = []
Expand Down

0 comments on commit 55946f6

Please sign in to comment.