MCPcopy Create free account

hub / github.com/SpaceXLaunchBot/SpaceXLaunchBot / functions

Functions62 in github.com/SpaceXLaunchBot/SpaceXLaunchBot

↓ 8 callersMethodsize_ok
Determines if an embed is within the size limits for discord. See https://discord.com/developers/docs/resources/channel#embed-limits
spacexlaunchbot/embeds/better_embed.py:29
↓ 7 callersMethodregister_metric
Register an action occurring to the metrics table. Args: action: The name of the action, naming convention is camel_case.
spacexlaunchbot/storage.py:154
↓ 4 callersFunctionmd_link
Makes strings easier to read when defining markdown links.
spacexlaunchbot/utils/misc.py:39
↓ 3 callersMethodsend_notification
Send a notification message to all channels subscribed to the given type. Args: to_send: A string or discord.Embed object.
spacexlaunchbot/discordclient.py:252
↓ 3 callersMethodupdate_website_metrics
Update bot list websites with guild count
spacexlaunchbot/discordclient.py:181
↓ 2 callersMethod_send_s
Safely send a text / embed message to a channel. Logs any errors that occur. Args: channel: A discord.Channel object.
spacexlaunchbot/discordclient.py:221
↓ 2 callersFunctiondiscord_timestamp_from_time
Converts a date string to Discord timestamp format. Args: date_string: An ISO format date string or None. Returns:
spacexlaunchbot/utils/misc.py:19
↓ 2 callersMethodinteraction_from_admin
(interaction: discord.Interaction)
spacexlaunchbot/discordclient.py:338
↓ 2 callersFunctionread_local_file
(f_name)
setup.py:9
↓ 2 callersMethodremove_subbed_channel
(self, channel_id: str)
spacexlaunchbot/storage.py:140
↓ 2 callersMethodsave_state
(self)
spacexlaunchbot/storage.py:53
↓ 2 callersMethodset_notification_task_vars
( self, launch_embed_for_current_schedule_sent: bool, previous_schedule_embed_dict:
spacexlaunchbot/storage.py:69
↓ 2 callersMethodsubbed_channels_count
(self)
spacexlaunchbot/storage.py:148
↓ 1 callersFunction_post_count_to_bot_list
(bl_data: Dict[str, str], guild_count: int)
spacexlaunchbot/apis/bot_lists.py:9
↓ 1 callersMethodadd_subbed_channel
Add a channel to subscribed channels. Args: channel_id: The channel to add. channel_name: The name of the channel
spacexlaunchbot/storage.py:81
↓ 1 callersFunctioncheck_and_send_notifications
Checks what notification messages need to be sent, and sends them. Updates database values if they need updating. Args: client:
spacexlaunchbot/notifications.py:22
↓ 1 callersMethodday_old_counts
Get guild and subsribed count from 24 hours ago. Returns: guild count, subscribed channel count
spacexlaunchbot/storage.py:207
↓ 1 callersMethoddisconnected_logger
Sleep for 2 seconds then log a disconnect.
spacexlaunchbot/discordclient.py:170
↓ 1 callersMethodfire
Shoot our record at Postgres, don't really care if it fails.
spacexlaunchbot/utils/postgres_logger.py:16
↓ 1 callersMethodget_notification_task_vars
(self)
spacexlaunchbot/storage.py:63
↓ 1 callersMethodget_subbed_channels
(self)
spacexlaunchbot/storage.py:126
↓ 1 callersFunctionmain
()
spacexlaunchbot/__main__.py:4
↓ 1 callersMethodset_playing
(self, title: str)
spacexlaunchbot/discordclient.py:213
↓ 1 callersMethodshutdown
Disconnects from Discord and cancels asyncio tasks
spacexlaunchbot/discordclient.py:191
↓ 1 callersMethodstart_db_counts_loop
A loop that every hour sends the guild and subscribed counts to the db.
spacexlaunchbot/discordclient.py:296
↓ 1 callersMethodstart_notification_loop
A loop that sends out launching soon & launch info notifications.
spacexlaunchbot/discordclient.py:312
↓ 1 callersFunctionsys_info
Returns a JSON string of system information (useful for debugging).
spacexlaunchbot/utils/misc.py:44
↓ 1 callersMethodupdate_counts
Insert new guild and subscribed channel counts into the db. Args: guild_count: The number of guilds the bot is currently in.
spacexlaunchbot/storage.py:180
Method__init__
(self, *args, **kwargs)
spacexlaunchbot/discordclient.py:25
Method__init__
(self, db_pool: asyncpg.Pool, pickle_file_path: str)
spacexlaunchbot/storage.py:35
Method__init__
( self, fmt: str, loop: asyncio.AbstractEventLoop, db_pool: asyncpg.Pool )
spacexlaunchbot/utils/postgres_logger.py:8
Method__init__
Extends the discord.Embed class with more functionality. Args: fields: A list of pairs of strings, the name and text of each fiel
spacexlaunchbot/embeds/better_embed.py:7
Methodcommand_add
( self, interaction: discord.Interaction, notification_type: str, notification
spacexlaunchbot/discordclient.py:368
Methodcommand_debug_launch_embed
Send a launch notification embed for the given launch.
spacexlaunchbot/adminclient.py:46
Methodcommand_help
(self, interaction: discord.Interaction)
spacexlaunchbot/discordclient.py:459
Methodcommand_info
(self, interaction: discord.Interaction)
spacexlaunchbot/discordclient.py:439
Methodcommand_next_launch
(self, interaction: discord.Interaction)
spacexlaunchbot/discordclient.py:345
Methodcommand_remove
(self, interaction: discord.Interaction)
spacexlaunchbot/discordclient.py:415
Methodcommand_reset_notification_task_store
Reset notification_task_store to default (will trigger new notifications).
spacexlaunchbot/adminclient.py:34
Methodcommand_trigger_launch_notification
Trigger a standard launch notification.
spacexlaunchbot/adminclient.py:57
Functioncreate_info_embed
Creates an info embed. Args: guild_count: The number of guilds the bot is currently a member of. guild_count_diff:
spacexlaunchbot/embeds/create.py:147
Functioncreate_interaction_embed
Creates an embed to be sent in response to a command, e.g. `add`. Args: desc: What happened? success: Was the interaction suc
spacexlaunchbot/embeds/create.py:201
Functioncreate_launch_embed
Create a launch embed from a dict of launch information. Args: launch_info: A dictionary of launch information from apis.spacex.
spacexlaunchbot/embeds/create.py:108
Functioncreate_schedule_embed
Creates an informational (schedule) embed from a dict of launch information. Args: launch_info: A dictionary of launch information fro
spacexlaunchbot/embeds/create.py:20
Functiondiff_schedule_embed_dicts
Takes 2 schedule embed dicts and returns a string containing the differences
spacexlaunchbot/embeds/diff.py:4
Methodemit
(self, record)
spacexlaunchbot/utils/postgres_logger.py:38
Functionget_launch_dict
Get a launch information dictionary for the given launch. If launch_number <= 0 (the default), get the next upcoming launch.
spacexlaunchbot/apis/ll2.py:29
Methodlatency_ms
Converts the latency property to an int representing the value in ms.
spacexlaunchbot/discordclient.py:82
Methodon_connect
(self)
spacexlaunchbot/discordclient.py:90
Methodon_disconnect
(self)
spacexlaunchbot/discordclient.py:93
Methodon_guild_join
(self, guild)
spacexlaunchbot/discordclient.py:153
Methodon_guild_remove
(self, guild)
spacexlaunchbot/discordclient.py:158
Methodon_ready
(self)
spacexlaunchbot/adminclient.py:14
Methodon_ready
(self)
spacexlaunchbot/discordclient.py:111
Methodon_resumed
(self)
spacexlaunchbot/discordclient.py:98
Functionpost_all_bot_lists
(guild_count: int)
spacexlaunchbot/apis/bot_lists.py:21
Methodsetup_hook
(self)
spacexlaunchbot/discordclient.py:32
Functionsetup_logging
Setup logging.
spacexlaunchbot/utils/misc.py:34
Functiontest_embed_is_invalid
()
tests/test_embeds.py:11
Functiontest_embed_is_valid
()
tests/test_embeds.py:4
Functionutc_from_time
(date_string: Union[str, None])
spacexlaunchbot/utils/misc.py:13
Functionvalidate
()
spacexlaunchbot/config.py:107