I'd like to know how I could make this script send the result (won or lost) on the specific user's direct message, here is a simple example of this:
from discord.ext import commands
import discord
import os
from random import *
client = commands.Bot(command_prefix = '-')
@client.event
async def on_ready():
print('Bot Is Ready')
@client.command() #The command in order to execute the script first
async def dm(ctx):
rand_num = (randint(1, 3))
win_num = 1
if rand_num == win_num:
print("number was:", rand_num)
print("won")
@client.event
async def on_win():
dmessage.send.user("You won!") #Send the won result message via direct message on discord automatically
elif rand_num != win_num:
print("number was:", rand_num)
print("lost")
@client.event
async def on_lost():
dmessage.send.user("You lost") #Send the lost result message via direct message on discord automatically
client.run('TOKEN')
Aucun commentaire:
Enregistrer un commentaire