| Conditions | 1 |
| Total Lines | 18 |
| Code Lines | 2 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | """Shared functions between cogs and main program""" |
||
| 50 | async def check_react(ctx, user, reaction, expected_react: str): |
||
| 51 | """check_reach |
||
| 52 | --- |
||
| 53 | Checks if the reaction on a message is correct and send by the same user that it was needed |
||
| 54 | from. |
||
| 55 | |||
| 56 | Arguments: |
||
| 57 | --- |
||
| 58 | ctx {discord.ext.commands.Context} -- Context of which the check was called.
|
||
| 59 | user {discord.User} -- User the reacted to the message
|
||
| 60 | reaction {discord.Reaction} -- The reaction that was added to the message
|
||
| 61 | expected_react {str} -- The desired reaction.
|
||
| 62 | |||
| 63 | Returns: |
||
| 64 | --- |
||
| 65 | bool -- Return 'TRUE' if it was the correct reaction from the correct user. |
||
| 66 | """ |
||
| 67 | return user == ctx.author and str(reaction.emoji) == expected_react |
||
| 68 |