|
class Mudae() |
|
Represents a mudae bot. Primarily used as a factory for Waifu objects.
Before doing anything with this class, make sure you've configured your mudae bot properly.
Kakera value must be visible on rolls, for this class to be able to read the messages from mudae.
If you want to check for claim or roll resets, a special timing list must be supplied.
Attributes
----------
mudae: discord.User
The mudea bot that this object belongs to.
This is usually the mudamaid if you got one, and if not, the classic mudae bot.
user: discord.Client
The client that's using this class.
Methods
-------
waifu_from(message)
Returns a waifu object from a waifu message.
is_wish(message, wishes, check_name, check_series)
Checks if the waifu from a waifu message is part of a list of wishes.
until_roll(in_seconds)
Returns how much time there's left until the next roll reset.
until_claim(in_seconds)
Returns how much time there's left until the next claim reset.
async wait_roll()
Pauses until next roll reset.
async wait_claim()
Pauses until next claim reset.
static get_timing(roll_mod, claim_mod, roll_rem, claim_rem, in_seconds)
Static method that returns a timing list from the supplied parameters. |
|
- __init__(user, mudae, timing=None)
- Parameters
----------
mudae: discord.User
The mudea bot that this object belongs to.
This is usually the mudamaid if you got one, and if not, the classic mudae bot.
user: discord.Client
The client that's using this class.
timing: list[int]
A timing list that should only be created by calling the static get_timing function on this class.
- is_wish(message, wishes, check_name=True, check_series=False)
- Checks if the waifu from a waifu message is part of a list of wishes.
If both check_name and check_series are true, the wishes will be checked against both name and series.
If both are false, the function will always return false.
Parameters
----------
message: discord.Message
A discord waifu message.
wishes: list
A list of strings, where each string is a wish.
check_name: bool
Whether the wishes are wishes for specific waifus.
check_series: bool
Whether the wishes are wishes for specific series.
Returns
-------
bool
Whether the waifu was wished.
- until_claim(in_seconds=False)
- Returns how much time there's left until the next claim reset.
Parameters
----------
in_seconds: bool
Whether the time returned should be in seconds or minutes.
Returns
-------
int
The time left until next claim reset.
- until_roll(in_seconds=False)
- Returns how much time there's left until the next roll reset.
Parameters
----------
in_seconds: bool
Whether the time returned should be in seconds or minutes.
Returns
-------
int
The time left until next roll reset.
- waifu_from(message)
- Returns a Waifu object from a waifu message.
Currently two types of messages are supported, rolls and infoes. Rolls are usually created with the $w command, and infoes with the $im command.
If the message supplied is none of the two valid types of messages, or is not valid for another reason, none is returned.
Parameters
----------
message: discord.Message
A discord message from mudae with a waifu (a waifu message).
Returns
-------
Mudae.Waifu
A waifu created from the message.
None
The message isn't valid.
- async wait_claim(self)
- Pauses until next claim reset.
- async wait_roll(self)
- Pauses until next roll reset.
- static get_timing(roll_mod, claim_mod, roll_rem, claim_rem, in_seconds=False)
- A static method that returns a timing list from the supplied parameters.
Parameters
----------
roll_mod: int
The time period, between roll resets. The default mudae value for this is 60 min.
claim_mod: int
The time period, between claim resets. The default mudae value for this is 120 min.
roll_rem: int
The time period, from now until the next roll reset.
claim_rem: int
The time period, from now until the next claim reset.
in_seconds: bool
If the time periods are given as seconds or minutes.
Returns
-------
list[int]
A list of integers that can be supplied to the constructor of this class.
| |