wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Discord.py Quiz

Total questions: 20

Worksheet time: 10mins

Name
Class
Date
1.

Which command is used to install the discord.py library via pip?

a)

pip install discord

b)

pip install discord.py

c)

npm install discord.js

d)

pip get discord

2.

What is the decorator used to register an event in a basic Client?

a)

@client.command

b)

@bot.event

c)

@client.event

d)

@event.register

3.

Which object represents the context in which a command is invoked?

a)

msg

b)

ctx

c)

context

d)

cxt

4.

What must be enabled in the Discord Developer Portal to track member joins/leaves?

a)

Server Intents

b)

Privileged Gateway Intents

c)

Bot Token

d)

Oauth2

5.

Which keyword is used to send a message back to the channel in a command?

a)

ctx.write()

b)

return message

c)

await ctx.send()

d)

ctx.reply_message()

6.

What acts as the prefix in this code: commands.Bot(command_prefix='!')?

a)

The dot (.)

b)

The exclamation mark (!)

c)

The word Bot

d)

No prefix is set

7.

Which function is commonly used to print a message when the bot has successfully logged in?

a)

on_login

b)

on_connect

c)

on_ready

d)

on_start

8.

In discord.py, most API interacting functions must be awaited because the library is...

a)

Synchronous

b)

Asynchronous

c)

Multi-threaded

d)

Blocking

9.

What argument do you pass to 'client.run()' to start the bot?

a)

Client ID

b)

Client Secret

c)

Bot Token

d)

Public Key

10.

Which class allows you to create rich content messages with titles, descriptions, and colors?

a)

discord.RichText

b)

discord.Embed

c)

discord.Card

d)

discord.Message

11.

What is the primary purpose of 'Cogs' in discord.py?

a)

To increase bot speed

b)

To organize commands into classes/files

c)

To encrypt the token

d)

To play music

12.

How do you load an extension named 'music' located in the 'cogs' folder?

a)

bot.load('cogs.music')

b)

await bot.load_extension('cogs.music')

c)

import cogs.music

d)

bot.add_cog('music')

13.

Which decorator is used to check if a user has specific permissions before running a command?

a)

@commands.check_perms

b)

@commands.has_permissions

c)

@bot.verify

d)

@discord.permit

14.

What exception is raised when a user tries to run a command they don't have permission for?

a)

PermissionError

b)

AccessDenied

c)

MissingPermissions

d)

ForbiddenCommand

15.

In a Cog, what must be passed as the first argument to every command method?

a)

ctx

b)

self

c)

bot

d)

message

16.

How do you convert a user input string like '' directly into a Member object in a command argument?

a)

Use regex

b)

Type hint the argument with discord.Member

c)

Manually fetch the ID

d)

It happens automatically for all strings

17.

What is the correct way to change the bot's status (presence)?

a)

bot.set_status()

b)

await bot.change_presence()

c)

client.update_status()

d)

bot.status = 'online'

18.

What does 'bot.latency' return?

a)

The bot uptime

b)

The ping (latency) in seconds

c)

The number of servers

d)

The token age

19.

What is 'Sharding' used for in discord.py?

a)

Splitting the bot across multiple processes for high guild counts

b)

Deleting messages in bulk

c)

Sharing the token

d)

Creating slash commands

20.

Which library is built-in to discord.py for handling scheduled background tasks?

a)

discord.timer

b)

discord.ext.tasks

c)

asyncio.schedule

d)

threading