Conditions | 1 |
Total Lines | 19 |
Code Lines | 3 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | """Shared functions between cogs and main program""" |
||
38 | async def check_react( |
||
39 | ctx, member: discord.Member, reaction: discord.Reaction, expected_react: str |
||
40 | ) -> bool: |
||
41 | """Check reaction |
||
42 | |||
43 | Checks if the reaction on a message is correct and send by the same member that it was needed |
||
44 | from. |
||
45 | |||
46 | :param ctx: Message context |
||
47 | :param member: Member who reacted to the message |
||
48 | :type member: discord.Member |
||
49 | :param reaction: Reaction that was added to the message |
||
50 | :type reaction: discord.Reaction |
||
51 | :param expected_react: String of wanted reaction |
||
52 | :type expected_react: str |
||
53 | :return: Correct reaction from the correct member. |
||
54 | :rtype bool: |
||
55 | """ |
||
56 | return member == ctx.author and str(reaction.emoji) == expected_react |
||
57 |