Answer the question
In order to leave comments, you need to log in
How to implement this in discord.py?
In short, I know the question is stupid, but help me, I'm just a beginner
, how to make the code where the random is activated again when writing the command, please tell me
here is the code:
import random
from random import randint
import discord
from discord.ext import commands
prefix = "."
bot = commands.Bot(command_prefix = prefix)
#random
rand3 = ["Добрый мишка -- Секретный","Мишка с мишонкой -- Секретный"]
rand2 = ["Обычный мишка - обычный", "Мишка на стуле с шипами - Редкий", "Мишка без мишки - обычный"]
rand1 = ["Мишка сидит и ест мишку - Эпик", "Мишка смотртит хентай - Легендарный", "Мишка сидит на бебре - мифичисекий","Злой мишка -- Легендарный","Белый миша -- Невозможный","мишка ест мороженое -- Легенадрный", "Мишка с мишонкой -- Секретный"]
r = (random.randint(1,1000))
if r <= 500:
randc = (random.choice(rand2))
elif r >= 800:
randc = (random.choice(rand1))
elif r <= 950:
print(random.choice(rand3))
#bot
@bot.event
async def on_ready():
print("The bot is ready!")
@bot.command(pass_context = True)
async def Mishka(ctx):
await ctx.send(randc)
Answer the question
In order to leave comments, you need to log in
import random
from random import randint
import discord
from discord.ext import commands
prefix = "."
bot = commands.Bot(command_prefix = prefix)
#bot
@bot.event
async def on_ready():
print("The bot is ready!")
@bot.command(pass_context = True)
async def Mishka(ctx):
rand3 = ["Добрый мишка -- Секретный","Мишка с мишонкой -- Секретный"]
rand2 = ["Обычный мишка - обычный", "Мишка на стуле с шипами - Редкий", "Мишка без мишки - обычный"]
rand1 = ["Мишка сидит и ест мишку - Эпик", "Мишка смотртит хентай - Легендарный", "Мишка сидит на бебре - мифичисекий","Злой мишка -- Легендарный","Белый миша -- Невозможный","мишка ест мороженое -- Легенадрный", "Мишка с мишонкой -- Секретный"]
r = (random.randint(1,1000))
if r <= 500:
randc = (random.choice(rand2))
elif r >= 800:
randc = (random.choice(rand1))
elif r <= 950:
print(random.choice(rand3))
await ctx.send(randc)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question