K
K
Kirill Kochurov2020-07-08 19:58:48
Python
Kirill Kochurov, 2020-07-08 19:58:48

How to create game teams on Discord.Py?

How to make game commands on discord.py??
For example:
roll (drops out randomly from 0 to 100)
ball (User - I'm a fag Bot answers Yes / No / Maybe / Maybe partially)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Renat Ataev, 2020-07-08
@fanepka

This is a request, but I'll help anyway:
The name of the function is the command itself after entering the prefix. In the received parameters - then the text after the command
Example:
import discord, random

async def rand(ctx, num_a, num_b):
     await ctx.send("Это число: {}".format(random.randint(num_a, num_b)) # Также вместо .format() можно использовать f""

ctx - a mandatory parameter that is always passed
num_a - the first number
num_b - the second number

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question