Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Person314159/cs221bot
/ functions
Functions
168 in github.com/Person314159/cs221bot
⨍
Functions
168
◇
Types & classes
21
↓ 14 callers
Function
write_json
(data: dict, jsonfile: str)
util/json.py:9
↓ 8 callers
Method
_get_canvas_handler
(self, guild: discord.Guild)
cogs/canvas.py:275
↓ 8 callers
Method
delete
(subroot: Node, num: int)
cogs/tree.py:85
↓ 8 callers
Method
remove
`!remove` __`Remove song`__ **Aliases:** r **Usage:** !remove <index> **Examples:** `!remove 2` removes sec
cogs/music.py:424
↓ 6 callers
Method
clean_response
(self, res: Optional[str])
util/piazza_handler.py:349
↓ 6 callers
Function
create_file_if_not_exists
Creates file with given path (as str) if the file does not already exist. All required directories are created, too.
util/create_file.py:5
↓ 5 callers
Method
now
`!now` __`Currently playing`__ **Usage:** !now **Examples:** `!now` shows what's currently playing
cogs/music.py:327
↓ 4 callers
Method
_ids_converter
Converts tuple of string to set of int, removing duplicates. Each string must be parsable to an int. Parameters ----
util/canvas_handler.py:116
↓ 4 callers
Method
clear
(self)
cogs/music.py:178
↓ 4 callers
Method
convert
(self, ctx: commands.Context, argument: str)
util/custom_role_converter.py:6
↓ 4 callers
Method
get_body
(self, res: dict)
util/piazza_handler.py:362
↓ 3 callers
Method
add_channel
(self, channel: int)
util/piazza_handler.py:107
↓ 3 callers
Method
check_if_private
(self, post: dict)
util/piazza_handler.py:346
↓ 3 callers
Function
get_course_url
Parameters ---------- course_id : `str` Course id base_url : `str` Base URL of the Canvas instance's API Return
util/canvas_api_extension.py:36
↓ 3 callers
Method
get_post
Returns a dict that contains post information to be formatted and returned as an embed Parameters ---------- post_id
util/piazza_handler.py:238
↓ 3 callers
Function
read_json
(jsonfile: str)
util/json.py:4
↓ 3 callers
Method
stop
`!stop` __`Stop player`__ **Usage:** !stop **Examples:** `!stop` stops player
cogs/music.py:512
↓ 2 callers
Method
_make_timedelta
Makes a datetime.timedelta Parameters ---------- till_str : `str` Date/Time from due date of assignments
util/canvas_handler.py:458
↓ 2 callers
Function
can_connect_ssh
Check if we can establish an SSH connection to the server with the given IP. Parameters ---------- server_ip: `str` The IP o
cogs/serverstats.py:49
↓ 2 callers
Method
create_embed
(self)
cogs/music.py:155
↓ 2 callers
Method
delete_channels_from_file
For each text channel provided, we remove its id from the file with given path if the id is contained in the file.
util/canvas_handler.py:280
↓ 2 callers
Method
download_modules
Download all modules for a Canvas course, storing each module's id in `{COURSES_DIRECTORY}/{course.id}/modules.txt`. Includes unpubli
util/canvas_handler.py:182
↓ 2 callers
Method
fetch_posts_in_range
Returns up to `lim` JSON objects that represent a Piazza post posted today
util/piazza_handler.py:177
↓ 2 callers
Method
get_all_modules
Returns a list of all modules for the given course. Includes unpublished modules if `incl_unpublished` is `True` and we have access t
util/canvas_handler.py:198
↓ 2 callers
Method
get_assignments
Gets assignments for course(s) Parameters ---------- due : `None or str` Date/Time from due date of assi
util/canvas_handler.py:371
↓ 2 callers
Method
get_course_stream_ch
Gets announcements for course(s) Parameters ---------- since : `None or str` Date/Time from announcement
util/canvas_handler.py:298
↓ 2 callers
Method
send_canvas_track_msg
Sends an embed to ctx that lists the Canvas courses being tracked by c_handler.
cogs/canvas.py:69
↓ 2 callers
Method
send_piazza_posts
(self)
cogs/piazza.py:212
↓ 2 callers
Method
shuffle
`!shuffle` __`Shuffle queue`__ **Usage:** !shuffle **Examples:** `!shuffle` shuffles queue
cogs/music.py:459
↓ 2 callers
Method
store_channels_in_file
For each text channel provided, we add its id to the file with given path if the file does not already contain the id.
util/canvas_handler.py:219
↓ 2 callers
Method
track_course
Cause this CanvasHandler to start tracking the courses with given IDs. For each course, if the bot is tracking the course for the fi
util/canvas_handler.py:134
↓ 1 callers
Method
__init__
(self, source: YTDLSource)
cogs/music.py:151
↓ 1 callers
Method
_add_guild
(self, guild: discord.Guild)
cogs/canvas.py:264
↓ 1 callers
Method
_assignment_sender
(self, ch: CanvasHandler, data_list: list[list[str]], recorded_ass_ids: list[int], notify_role: discord.Role,
cogs/canvas.py:341
↓ 1 callers
Method
_get_assignment_data
Formats all courses assignments as separate assignments Parameters ---------- due : `None or str` Date/T
util/canvas_handler.py:397
↓ 1 callers
Method
_get_tracking_courses
(self, c_handler: CanvasHandler)
cogs/canvas.py:278
↓ 1 callers
Method
assignment_reminder
(self)
cogs/canvas.py:314
↓ 1 callers
Method
audio_player_task
(self)
cogs/music.py:224
↓ 1 callers
Method
canvas_init
(self)
cogs/canvas.py:513
↓ 1 callers
Method
check_modules
For every folder in handler.canvas_handler.COURSES_DIRECTORY (abbreviated as CDIR) we will: - get the modules for the Canvas course w
cogs/canvas.py:378
↓ 1 callers
Method
create_post_embed
(self, post: dict)
cogs/piazza.py:180
↓ 1 callers
Method
create_source
(cls, ctx: commands.Context, search: str, *, loop: asyncio.BaseEventLoop = None)
cogs/music.py:86
↓ 1 callers
Method
fetch_pinned
Returns up to `lim` JSON objects representing pinned posts\n Since pinned posts are always the first notes shown in a Piazza, lim can
util/piazza_handler.py:154
↓ 1 callers
Method
fetch_post_instance
Returns a JSON object representing a Piazza post with ID `post_id`, or returns None if post doesn't exist Parameters -------
util/piazza_handler.py:115
↓ 1 callers
Method
fetch_recent_notes
Returns up to `lim` JSON objects representing instructor's notes that were posted today Parameters ---------- lim :
util/piazza_handler.py:135
↓ 1 callers
Method
get_course_names
Gives a list of tracked courses and their urls Parameters ---------- url : `str` Base URL of the Canvas
util/canvas_handler.py:491
↓ 1 callers
Function
get_course_stream
Parameters ---------- course_id : `int` Course id base_url : `str` Base URL of the Canvas instance's API access
util/canvas_api_extension.py:6
↓ 1 callers
Method
get_first_image_url
(self, res: str)
util/piazza_handler.py:365
↓ 1 callers
Method
get_num_follow_ups
(self, answer: dict)
util/piazza_handler.py:284
↓ 1 callers
Method
get_pinned
Returns an array of `self.min` objects containing a pinned post's post id, title, and url.
util/piazza_handler.py:220
↓ 1 callers
Method
get_posts_in_range
(self, show_limit: int = 10, days: int = 1, seconds: int = 0)
util/piazza_handler.py:287
↓ 1 callers
Function
get_staff_ids
Parameters ---------- course : `Course` The course to get staff IDs for Returns ------- `List[int]` A list o
util/canvas_api_extension.py:56
↓ 1 callers
Method
get_voice_state
(self, ctx: commands.Context)
cogs/music.py:271
↓ 1 callers
Method
is_playing
(self)
cogs/music.py:221
↓ 1 callers
Method
parse_duration
(duration: int)
cogs/music.py:129
↓ 1 callers
Method
piazza_start
(self)
cogs/piazza.py:241
↓ 1 callers
Method
play
`!play` __`Play song`__ **Aliases:** p **Usage:** !play <url> **Examples:** `!play https://www.youtube.com/
cogs/music.py:357
↓ 1 callers
Method
print
(self, ctx: commands.Context)
util/badargs.py:18
↓ 1 callers
Method
remove_channel
(self, channel: int)
util/piazza_handler.py:111
↓ 1 callers
Method
send_at_time
(self)
cogs/piazza.py:197
↓ 1 callers
Method
send_pupdate
(self)
cogs/piazza.py:206
↓ 1 callers
Function
startup
()
cs221bot.py:56
↓ 1 callers
Function
status_task
()
cs221bot.py:31
↓ 1 callers
Method
stop
(self)
cogs/music.py:257
↓ 1 callers
Method
stream_tracking
(self)
cogs/canvas.py:288
↓ 1 callers
Method
untrack_course
Cause this CanvasHandler to stop tracking the courses with given IDs. Parameters ---------- course_ids_str : `tuple[
util/canvas_handler.py:243
↓ 1 callers
Method
update_modules
Every x interval, we check Canvas modules for courses being tracked, and send information about new modules to Discord channels that
cogs/canvas.py:366
Method
__del__
(self)
cogs/music.py:201
Method
__getitem__
(self, item)
cogs/music.py:166
Method
__init__
(self, bot: commands.Bot)
cogs/serverstats.py:9
Method
__init__
(self, bot: commands.Bot)
cogs/meta.py:12
Method
__init__
(self, bot: commands.Bot)
cogs/commands.py:39
Method
__init__
(self, bot: commands.Bot)
cogs/tree.py:17
Method
__init__
(self, bot: commands.Bot)
cogs/games.py:15
Method
__init__
(self, bot: commands.Bot)
cogs/piazza.py:24
Method
__init__
(self, bot: commands.Bot)
cogs/canvas.py:39
Method
__init__
(self, ctx: commands.Context, source: discord.FFmpegPCMAudio, *, data: dict, volume: float = 0.5)
cogs/music.py:62
Method
__init__
(self, bot: commands.Bot, ctx: commands.Context)
cogs/music.py:189
Method
__init__
(self, bot: commands.Bot)
cogs/music.py:266
Method
__init__
(self, name: str, nid: str, email: str, password: str, guild: discord.Guild, fetch_max: int = 55, fetch_min: i
util/piazza_handler.py:55
Method
__init__
Parameters ---------- api_url : `str` Base URL of the Canvas instance's API api_key : `str`
util/canvas_handler.py:46
Method
__init__
(self)
util/discord_handler.py:17
Method
__init__
(self, msg: str, show_help: bool = False)
util/badargs.py:14
Method
__iter__
(self)
cogs/music.py:172
Method
__len__
(self)
cogs/music.py:175
Method
__str__
(self)
cogs/music.py:82
Function
_urlencode
(*args, **kwargs)
cogs/commands.py:27
Method
annc
`!annc ( | (-since (n-(hour|day|week|month|year)) | YYYY-MM-DD | YYYY-MM-DD-HH:MM:SS) | -all)` Argument can be left blank for sendin
cogs/canvas.py:221
Method
asgn
`!asgn ( | (-due (n-(hour|day|week|month|year)) | YYYY-MM-DD | YYYY-MM-DD-HH:MM:SS) | -all)` Argument can be left blank for sending
cogs/canvas.py:108
Method
bst
`!bst` __`Binary Search Tree analysis tool`__ **Usage:** !bst <node> [node] [...] **Examples:** `!bst 2 1 3` displays
cogs/tree.py:22
Method
canvas_handlers
(self)
util/discord_handler.py:22
Method
channels
(self)
util/piazza_handler.py:100
Method
check_servers
`!checkservers` __`Check if the remote CS servers are online`__ **Usage** `!checkservers [server names]` **Valid server nam
cogs/serverstats.py:14
Method
chess
`!chess` __`Play chess`__ **Usage:** !chess <user> **Examples:** `!chess abc#1234` starts a game of chess with abc#
cogs/games.py:19
Method
cog_before_invoke
(self, ctx: commands.Context)
cogs/music.py:284
Method
cog_unload
(self)
cogs/music.py:280
Method
convert
(self, ctx: commands.Context, argument: str)
util/custom_member_converter.py:6
Method
course_name
(self)
util/piazza_handler.py:76
Method
courses
(self)
util/canvas_handler.py:69
Method
create_post_dict
(post: dict, tag: str)
util/piazza_handler.py:295
next →
1–100 of 168, ranked by callers