-
Notifications
You must be signed in to change notification settings - Fork 0
/
messages.py
142 lines (110 loc) · 4.97 KB
/
messages.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
import discord
import json
# List of embeded messages to clean up the code
def list_message(title):
embed = discord.Embed(title=title,
description="Please enter your list items separated by ; ",
color=0xFF5733)
embed.add_field(name="Example", value="Item1;Item2;Item3;Item4", inline=False)
embed.add_field(name="Support this project",
value="[Donate](https://www.paypal.com/donate?hosted_button_id=QY9QSBC63TL34)",
inline=False)
return embed
def timeout_message():
embed = discord.Embed(title="No list provided within timeout!",
description="There is 60s timeout. ",
color=0xFF5733)
embed.add_field(name="Example", value="Please start again with ?list command.", inline=False)
return embed
def format_error_message():
embed = discord.Embed(title="Format Error!",
description="Use ; separator between items! ",
color=0xFF5733)
embed.add_field(name="Example", value="Please start again with ?list command.", inline=False)
return embed
def list_exists_error_message():
embed = discord.Embed(title="List already exists!",
description="Please use unique list name.",
color=0xFF5733)
embed.add_field(name="Example", value="Please start again with ?list command.", inline=False)
return embed
def guild_join_message():
embed = discord.Embed(title="Thanks for inviting me:",
description="Following commands are available:",
color=0xFF5733)
embed.add_field(name="?list {ListName}",
value="Creates new list.",
inline=False)
embed.add_field(name="?random {ListName}",
value="Randomly selects one item from list.",
inline=False)
embed.add_field(name="?delete {ListName}",
value="Deletes existing list.",
inline=False)
embed.add_field(name="?commands",
value="Lists all available commands.",
inline=False)
return embed
def list_created_message(title):
embed = discord.Embed(title=title,
description="New list created!",
color=0xFF5733)
embed.add_field(name="Support this project",
value="[Donate](https://www.paypal.com/donate?hosted_button_id=QY9QSBC63TL34)",
inline=False)
return embed
def random_message(item):
embed = discord.Embed(title=item,
description="[Support this project](https://www.paypal.com/donate?hosted_button_id=QY9QSBC63TL34)",
color=0xFF5733)
return embed
def delete_message(title):
embed = discord.Embed(title=title,
description="List deleted!",
color=0xFF5733)
embed.add_field(name="Support this project",
value="[Donate](https://www.paypal.com/donate?hosted_button_id=QY9QSBC63TL34)",
inline=False)
return embed
def commands_message():
embed = discord.Embed(title="Commands:",
description="Following commands are available:",
color=0xFF5733)
embed.add_field(name="?commands",
value="Lists all available commands.",
inline=False)
embed.add_field(name="?delete {ListName}",
value="Deletes existing list.",
inline=False)
embed.add_field(name="?list {ListName}",
value="Creates new list.",
inline=False)
embed.add_field(name="?random {ListName}",
value="Randomly selects one item from the list.",
inline=False)
embed.add_field(name="?showlists",
value="Prints all available lists for the user.",
inline=False)
embed.add_field(name="?yesno",
value="Gives Yes or No answer.",
inline=False)
embed.add_field(name="?8ball",
value="Gives random 8ball answer.",
inline=False)
return embed
def print_lists_message(array, length):
embed = discord.Embed(title="Show all lists",
description="Following lists are availible to you:",
color=0xFF5733)
for i in range(length):
item = array[i]
item = json.dumps(item)
item = item.replace('{"List_Name": "', '')
item = item.replace('"}', '')
embed.add_field(name=item,
value="\u200b",
inline=False)
embed.add_field(name="Support this project",
value="[Donate](https://www.paypal.com/donate?hosted_button_id=QY9QSBC63TL34)",
inline=False)
return embed