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

Sherpmail #88

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

AaryanHazCompter
Copy link

I saw an issue Ian raised about wanting a way to (a) communicate to the server through the bot (b) have the server communicate to him through the bot; the idea seemed funny enough so I coded it - there's little error handling, no accounting for excess characters, no graphics and attachment handling, and definitely no spam prevention - however I am sleep deprived and wanted to make what is basically a letter mail system work to a reasonable extent.

I have never split PRs in my life I don't know what I did but I hope this is right lol

jadc and others added 3 commits April 5, 2024 16:13
* fix: votedelete and starboard works on uncached messages
I saw an issue Ian raised about wanting a way to (a) communicate to the server through the bot (b) have the server communicate to him through the bot and the idea seemed funny so I coded it - there's little error handling, no accounting for excess characters, no graphics and attachment handling, and definitely no spam prevention - however I am sleep deprived and wanted to make what is basically a letter mail system work to a reasonable extent.
@AaryanHazCompter AaryanHazCompter marked this pull request as ready for review April 5, 2024 22:28
@IanDeHaan
Copy link
Contributor

OMG MERGE MERGE MERGE

Copy link
Contributor

@Mattwmaster58 Mattwmaster58 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good for the most part, have you tested this on yourself?


@commands.Cog.listener()
async def on_message(self, message: discord.Message):
if (message.guild == None) and (message.author.id == 214657501193306112):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (message.guild == None) and (message.author.id == 214657501193306112):
if (message.channel.type === 'dm') and (message.author.id == 214657501193306112):

I think this is clearer

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adjusted to message.channel.type.name == "private" and it will reflect on the next commit.

self.sherp = await interaction.client.fetch_user(212613981465083906)
try:
embed = discord.Embed(
title = f"📬 You've got mail! **@{interaction.user} | ID: {interaction.user.id}** sent you the following:",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems incorrect, unless discord.py has some special __repr__ stuff I'm ignorning. I think we should mention interaction.user.global_name and interaction.user.name. The numeric ID isn't too useful IDT.

https://discordpy.readthedocs.io/en/stable/interactions/api.html?highlight=interaction#discord.Interaction.user

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The unique UID and user would prevent someone from writing stupid things as they would know that their identifiers were also being sent to Sherp. I did rewrite it and have it stated in the footer of the embed instead.

# Nonetheless it is nearly 6am and I felt the need to complete this
# I hope it works out and nobody abuses it lol good luck

class sherpMailbox(commands.Cog):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
class sherpMailbox(commands.Cog):
class SherpMailbox(commands.Cog):

(style)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call! Applied to the incoming commit.

Modified sherpmail cog from a cosmetic perspective based on inputs from Matt; added sherpmail cog to init file for setup and consistency
@Sooraj-beep
Copy link
Owner

OMG MERGE MERGE MERGE

Are you sure u want this? Could result in a lot of spam which you may not even be able to block (afaik)

@AaryanHazCompter
Copy link
Author

OMG MERGE MERGE MERGE

Are you sure u want this? Could result in a lot of spam which you may not even be able to block (afaik)

I do believe you can restrict specific application commands to specific channels - you can create a designated channel and set an extended slow mode timer on that chat which impacts individual users. Additionally, Ian can block and/or mute DMs and it would be as if the bot was never texting him in the first place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants