-
Notifications
You must be signed in to change notification settings - Fork 2
/
bot_refuse.py
65 lines (56 loc) · 1.89 KB
/
bot_refuse.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import discord
import asyncio
import string
from random import SystemRandom
class refuse:
REFUSAL_CHANCE = 0.1
_rand = SystemRandom()
simple = [
"I refuse to comply.",
"You're annoying.",
"\**Sigh* \* Filthy peasants."]
advanced = [
"seriously"]
moods = [
"The bot seems joyful.",
"The bot seems happy.",
"The bot seems content.",
"The bot seems annoyed.",
"The bot seems pretty unhappy.",
"It's pissed.",
"The bot is ignoring you now. Good luck.",
]
# def __init__(self):
# self.anger_level = 0
@staticmethod
def get_mood():
return refuse.moods[int(refuse.REFUSAL_CHANCE * (len(refuse.moods) - 1))]
@staticmethod
def set_refusal_level(pct):
if pct >= 0 and pct <= 1:
refuse.REFUSAL_CHANCE = pct
elif pct >= -100 and pct <= 100:
refuse.REFUSAL_CHANCE = abs(pct) / 100
else:
return False
return True
@staticmethod
def get_refusal_level():
return refuse.REFUSAL_CHANCE
@staticmethod
def think_about_refusing():
return refuse._rand.random() < refuse.REFUSAL_CHANCE
@staticmethod
async def send_refusal(message, args, author, client):
# refusal_List = refuse.advanced if (args and args[0] == '-a') else refuse.simple
refusal_Message = '> ' + refuse._rand.choice(refuse.simple)
await message.channel.send(refusal_Message)
async def refusalLevel(message, args, author, client) :
if len(args) == 0:
await message.channel.send(refuse.get_refusal_level())
return
if refuse.set_refusal_level(float(args[0])):
await message.channel.send(refuse.get_mood())
# await message.channel.send('<@{}>'.format(author.id))
async def mood(message, args, author, client) :
await message.channel.send(refuse.get_mood())