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

Reactions Bug (Posting w/ Non-Star Emojis) #1

Open
darrenvasquez opened this issue Nov 6, 2020 · 0 comments
Open

Reactions Bug (Posting w/ Non-Star Emojis) #1

darrenvasquez opened this issue Nov 6, 2020 · 0 comments
Assignees

Comments

@darrenvasquez
Copy link
Owner

darrenvasquez commented Nov 6, 2020

Will allow any messages with over the threshold of reactions to be posted in the starboard, as long as at least one of the reactions is in starboard_emojis.

Might just wanna allow anything to be posted in starboard as long as it passes the threshold for emoji count, not just specific ones.

discord-bot/discord_bot.py

Lines 102 to 127 in 668e313

async def on_reaction_add(reaction, user):
if reaction.message.guild:
if isinstance(reaction.emoji, str) and reaction.emoji in starboard_emojis:
for react in reaction.message.reactions:
if (isinstance(reaction.emoji, str)) and (reaction.emoji in starboard_emojis):
react_users = await react.users().flatten()
count = 0 # temporary, go back to 0
for react_user in react_users:
if not react_user.id == user.id:
count += 1
if count > 2: # temporary, go back to 2
if not reaction.message.id in starboard_posts:
for channel in reaction.message.guild.text_channels:
if "starboard" in channel.name:
### Message Contents Created Here
embed=discord.Embed(title=reaction.message.content)
embed.set_author(name="{0}#{1} {2}".format(reaction.message.author.name, reaction.message.author.discriminator, reaction.emoji), url=reaction.message.jump_url, icon_url=reaction.message.author.avatar_url)
#embed.add_field(value=reaction.message.content)
embed.set_footer(text="click username to jump to message")
#embedMsg.add_field(name="", value="value")
if reaction.message.attachments:
embed.set_image(url=reaction.message.attachments[0].proxy_url)
await channel.send(embed=embed)
starboard_posts.append(reaction.message.id)
break
break

@darrenvasquez darrenvasquez self-assigned this Nov 6, 2020
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

No branches or pull requests

1 participant