-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstarbot.py
46 lines (41 loc) · 1.25 KB
/
starbot.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import discord
from discord.ext import commands
import random
import time
act = discord.Activity(name="Always ready to serve.")
TOKEN = None
client = discord.Client()
bot = commands.Bot(command_prefix='!', activity=act)
@client.event
async def on_message(message):
if message.content.startswith('salvo'):
time.sleep(2)
text = "\t\t\t. /\n" \
" _ - | -- -= *:--\n" \
"._(O) / ' `\n"
await message.channel.send('SALVO!')
time.sleep(2)
await message.channel.send(text)
time.sleep(2)
await message.channel.send("......")
time.sleep(2)
await message.channel.send("......")
time.sleep(2)
await message.channel.send("......")
time.sleep(1)
text = "\t'. \ | / ,'\n"\
" ( .`.|,' .)\n"\
"- ~ -0- ~ -"
@bot.command(name='roll')
async def roll(ctx, number_of_sides):
try:
number_of_sides = int(str(number_of_sides[1]) + str(number_of_sides[2]))
except IndexError:
print("error")
number_of_sides = int(str(number_of_sides[1]))
finally:
dice = str(random.choice(range(1, number_of_sides + 1)))
await ctx.channel.send(dice)
def run():
client.run(TOKEN)
bot.run(TOKEN)