Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/SpaceXLaunchBot/SpaceXLaunchBot
/ functions
Functions
62 in github.com/SpaceXLaunchBot/SpaceXLaunchBot
⨍
Functions
62
◇
Types & classes
7
↓ 8 callers
Method
size_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 callers
Method
register_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 callers
Function
md_link
Makes strings easier to read when defining markdown links.
spacexlaunchbot/utils/misc.py:39
↓ 3 callers
Method
send_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 callers
Method
update_website_metrics
Update bot list websites with guild count
spacexlaunchbot/discordclient.py:181
↓ 2 callers
Method
_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 callers
Function
discord_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 callers
Method
interaction_from_admin
(interaction: discord.Interaction)
spacexlaunchbot/discordclient.py:338
↓ 2 callers
Function
read_local_file
(f_name)
setup.py:9
↓ 2 callers
Method
remove_subbed_channel
(self, channel_id: str)
spacexlaunchbot/storage.py:140
↓ 2 callers
Method
save_state
(self)
spacexlaunchbot/storage.py:53
↓ 2 callers
Method
set_notification_task_vars
( self, launch_embed_for_current_schedule_sent: bool, previous_schedule_embed_dict:
spacexlaunchbot/storage.py:69
↓ 2 callers
Method
subbed_channels_count
(self)
spacexlaunchbot/storage.py:148
↓ 1 callers
Function
_post_count_to_bot_list
(bl_data: Dict[str, str], guild_count: int)
spacexlaunchbot/apis/bot_lists.py:9
↓ 1 callers
Method
add_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 callers
Function
check_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 callers
Method
day_old_counts
Get guild and subsribed count from 24 hours ago. Returns: guild count, subscribed channel count
spacexlaunchbot/storage.py:207
↓ 1 callers
Method
disconnected_logger
Sleep for 2 seconds then log a disconnect.
spacexlaunchbot/discordclient.py:170
↓ 1 callers
Method
fire
Shoot our record at Postgres, don't really care if it fails.
spacexlaunchbot/utils/postgres_logger.py:16
↓ 1 callers
Method
get_notification_task_vars
(self)
spacexlaunchbot/storage.py:63
↓ 1 callers
Method
get_subbed_channels
(self)
spacexlaunchbot/storage.py:126
↓ 1 callers
Function
main
()
spacexlaunchbot/__main__.py:4
↓ 1 callers
Method
set_playing
(self, title: str)
spacexlaunchbot/discordclient.py:213
↓ 1 callers
Method
shutdown
Disconnects from Discord and cancels asyncio tasks
spacexlaunchbot/discordclient.py:191
↓ 1 callers
Method
start_db_counts_loop
A loop that every hour sends the guild and subscribed counts to the db.
spacexlaunchbot/discordclient.py:296
↓ 1 callers
Method
start_notification_loop
A loop that sends out launching soon & launch info notifications.
spacexlaunchbot/discordclient.py:312
↓ 1 callers
Function
sys_info
Returns a JSON string of system information (useful for debugging).
spacexlaunchbot/utils/misc.py:44
↓ 1 callers
Method
update_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
Method
command_add
( self, interaction: discord.Interaction, notification_type: str, notification
spacexlaunchbot/discordclient.py:368
Method
command_debug_launch_embed
Send a launch notification embed for the given launch.
spacexlaunchbot/adminclient.py:46
Method
command_help
(self, interaction: discord.Interaction)
spacexlaunchbot/discordclient.py:459
Method
command_info
(self, interaction: discord.Interaction)
spacexlaunchbot/discordclient.py:439
Method
command_next_launch
(self, interaction: discord.Interaction)
spacexlaunchbot/discordclient.py:345
Method
command_remove
(self, interaction: discord.Interaction)
spacexlaunchbot/discordclient.py:415
Method
command_reset_notification_task_store
Reset notification_task_store to default (will trigger new notifications).
spacexlaunchbot/adminclient.py:34
Method
command_trigger_launch_notification
Trigger a standard launch notification.
spacexlaunchbot/adminclient.py:57
Function
create_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
Function
create_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
Function
create_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
Function
create_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
Function
diff_schedule_embed_dicts
Takes 2 schedule embed dicts and returns a string containing the differences
spacexlaunchbot/embeds/diff.py:4
Method
emit
(self, record)
spacexlaunchbot/utils/postgres_logger.py:38
Function
get_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
Method
latency_ms
Converts the latency property to an int representing the value in ms.
spacexlaunchbot/discordclient.py:82
Method
on_connect
(self)
spacexlaunchbot/discordclient.py:90
Method
on_disconnect
(self)
spacexlaunchbot/discordclient.py:93
Method
on_guild_join
(self, guild)
spacexlaunchbot/discordclient.py:153
Method
on_guild_remove
(self, guild)
spacexlaunchbot/discordclient.py:158
Method
on_ready
(self)
spacexlaunchbot/adminclient.py:14
Method
on_ready
(self)
spacexlaunchbot/discordclient.py:111
Method
on_resumed
(self)
spacexlaunchbot/discordclient.py:98
Function
post_all_bot_lists
(guild_count: int)
spacexlaunchbot/apis/bot_lists.py:21
Method
setup_hook
(self)
spacexlaunchbot/discordclient.py:32
Function
setup_logging
Setup logging.
spacexlaunchbot/utils/misc.py:34
Function
test_embed_is_invalid
()
tests/test_embeds.py:11
Function
test_embed_is_valid
()
tests/test_embeds.py:4
Function
utc_from_time
(date_string: Union[str, None])
spacexlaunchbot/utils/misc.py:13
Function
validate
()
spacexlaunchbot/config.py:107