discord_lfg.group_builder
Main DB instance control.
logger = logging.getLogger(__name__)
module-attribute
#
EditCreatorRole(open_roles)
#
Bases: Select
Creator role selector.
Initialisation.
Source code in src\discord_lfg\group_builder.py
callback(interaction)
async
#
Does the thing.
Source code in src\discord_lfg\group_builder.py
EditRemoveUser(users)
#
Bases: Select
Select which users to remove.
Initialisation.
Source code in src\discord_lfg\group_builder.py
callback(interaction)
async
#
Does the thing.
Source code in src\discord_lfg\group_builder.py
EditRemoveUserReason(users, kick_reasons)
#
Bases: Select
Provide a reason for removing users.
Initialisation.
Source code in src\discord_lfg\group_builder.py
callback(interaction)
async
#
Does the thing.
Source code in src\discord_lfg\group_builder.py
GroupBuilder(interaction, group_info, config, creator_role, filled_spots)
#
Builds a group dynamically.
Creates a Group Builder.
| PARAMETER | DESCRIPTION |
|---|---|
interaction
|
The discord interaction which created this GroupBuilder. This allows us to capture the user information depending on who created this instance.
TYPE:
|
group_info
|
A dictionary of the group specific information: see
TYPE:
|
config
|
A dictionary of configuration information for Group Builder, all optional extras
TYPE:
|
creator_role
|
The role the creator has chosen (must match a role name)
TYPE:
|
filled_spots
|
A dictionary of which roles are already filled in the format {name: count} |
Source code in src\discord_lfg\group_builder.py
creator = self.create_user_from_interaction(interaction, creator_role, True)
instance-attribute
#
current_role_tags
property
#
Retrieves a string tagging all current required roles listed in the group.
current_user_ids
property
#
Retrieves the current valid user IDs in the instance.
current_user_tags
property
#
Retrieves a string tagging all current users listed in the group.
description
property
#
Gets a standardised description for the group including role spots.
filled_roles
property
#
Gets a string indicating the roles that have been filled, as emojis.
group_buttons
property
#
A set of buttons for manipulating the group while it's open.
group_editor = None
instance-attribute
#
group_embed
property
#
Gets a Discord Embed of the current group user state.
group_title
property
#
Gets a standardised title string for the group.
kicked_users = []
instance-attribute
#
listing_message
property
#
Gets the listing message for the group.
listing_message_body
property
#
Body of the listing message.
passphrase
property
#
Retrieves the passphrase for this group.
role_counts = {(role.name): (role.count) for role in (config.roles.values())}
instance-attribute
#
add_role(assigned_role, group_user, filled_spot=False)
#
Update the specified role name with the given user ID and display name.
Source code in src\discord_lfg\group_builder.py
cancel_group()
async
#
Cancels the group and informs all current signups that it's been cancelled.
Source code in src\discord_lfg\group_builder.py
create_user_from_interaction(interaction, role, creator=False)
#
Creates a GroupUser from a given discord interaction.
Source code in src\discord_lfg\group_builder.py
edit_message()
async
#
Updates the Discord displayed message based on the current status of the group.
Source code in src\discord_lfg\group_builder.py
fill_spots(filled_spots)
#
Fills spots in the listing based on the filled spots dictionary given.
Source code in src\discord_lfg\group_builder.py
get_role_by_id(user_id)
#
Retrieves a user from the roles using their id.
Source code in src\discord_lfg\group_builder.py
get_user_by_id(user_id)
#
Retrieves a user from the roles using their id.
Source code in src\discord_lfg\group_builder.py
is_closed()
#
Checks if the group should be closed or re-opened and sets a timer accordingly.
Source code in src\discord_lfg\group_builder.py
remove_filled_spot(user)
#
remove_role(role, id)
#
Removes the role from the given user.
Source code in src\discord_lfg\group_builder.py
role_info(role_name)
#
Gets information about the requested role.
send_message(interaction)
async
#
Sends the initial message for the Group Builder.
Source code in src\discord_lfg\group_builder.py
send_passphrase(interaction)
async
#
Sends the passphrase.
Source code in src\discord_lfg\group_builder.py
GroupDetails(activity_name, listed_as, creator_notes, extra_info, kick_reasons)
dataclass
#
GroupEditOptions(group_builder)
#
Bases: View
LFG options menu.
Initialisation.
Source code in src\discord_lfg\group_builder.py
cancel_group_state = 0
instance-attribute
#
confirmed = False
instance-attribute
#
creator_role = role_name
instance-attribute
#
edit_creator_role = EditCreatorRole(open_roles)
instance-attribute
#
edit_remove_users = EditRemoveUser(removeable_users)
instance-attribute
#
edit_remove_users_reason = EditRemoveUserReason(removeable_users, kick_reasons)
instance-attribute
#
filled_spot_name = self.group_builder.state.filled_spot_name
instance-attribute
#
group_builder = group_builder
instance-attribute
#
interaction = None
instance-attribute
#
message = None
instance-attribute
#
new_creator_role = self.creator_role
instance-attribute
#
remove_users = []
instance-attribute
#
remove_users_reason = ''
instance-attribute
#
cancel_edit(interaction, button)
async
#
Cancel the menu.
Source code in src\discord_lfg\group_builder.py
cancel_group(interaction, button)
async
#
Cancel the menu.
Source code in src\discord_lfg\group_builder.py
confirm_edit(interaction, button)
async
#
Confirm the edits.
Source code in src\discord_lfg\group_builder.py
on_group_close()
async
#
Do stuff when the group managing this editor is closed.
Source code in src\discord_lfg\group_builder.py
on_timeout()
async
#
Do stuff when timeout occurs.
Source code in src\discord_lfg\group_builder.py
GroupRole(name, users, assigned, button_style, disabled, emoji, role_mention)
dataclass
#
GroupState(command_name, created_at, close_group_at, editable_length, closed, cancelled, timed_out, empty_spots, filled_spots, filled_spot_name, passphrase, debug, empty_filled_role_increment=-1)
dataclass
#
Container for the state of the group.
cancelled
instance-attribute
#
close_group_at
instance-attribute
#
closed
instance-attribute
#
command_name
instance-attribute
#
created_at
instance-attribute
#
debug
instance-attribute
#
editable_length
instance-attribute
#
empty_filled_role_increment = -1
class-attribute
instance-attribute
#
empty_spots
instance-attribute
#
filled_spot_name
instance-attribute
#
filled_spots
instance-attribute
#
passphrase
instance-attribute
#
timed_out
instance-attribute
#
GroupUser(id, tag, name, display_name, global_name, interaction, creator, role, removal_reason='')
dataclass
#
Container for discord user information relevant to building a group.