-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
303 lines (271 loc) · 12.1 KB
/
main.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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
# main.py
#https://GooseAttackBot--bonniepeng.repl.co
#https://repl.it/talk/learn/Hosting-discordpy-bots-with-replit/11008
import keep_alive
import os, random, discord
from discord.ext import commands
from dotenv import load_dotenv
from discord.utils import find
load_dotenv()
TOKEN = os.getenv('DISCORD_TOKEN')
bot = commands.Bot(command_prefix='$')
client = discord.Client()
#---------------------FILES----------------------
uno = discord.Embed()
uno.set_image(url='https://media.tenor.com/images/ee6e6bb6f35b030eab0dbb7c12040275/tenor.gif')
hap = discord.Embed()
hap.set_image(url='https://m5.paperblog.com/i/68/686386/here-is-theat-happy-goose-again-and-another-o-L-jYMqei.jpeg')
sad = discord.Embed()
sad.set_image(url='https://i1.sndcdn.com/avatars-000178938366-zw94tr-t500x500.jpg')
ang = discord.Embed()
ang.set_image(url='https://i.redd.it/ziyrjzn4fho21.png')
shok = discord.Embed()
shok.set_image(url='https://live.staticflickr.com/5292/5396005497_a4cd1bf1c8_z.jpg')
hung = discord.Embed()
hung.set_image(url='https://i.imgur.com/rYmPYCt.gif')
vio = discord.Embed()
vio.set_image(url='https://i.makeagif.com/media/6-12-2015/K1orJG.gif')
horn = discord.Embed()
horn.set_image(url='https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcT98AG67oRaL_7Dl0eknAKk6AVck34pzqE9Yg&usqp=CAU')
gang = discord.Embed()
gang.set_image(url='https://a.wattpad.com/cover/84215647-352-k186022.jpg')
lone=discord.Embed()
lone.set_image(url='https://i.redd.it/og8zaq3fib521.jpg')
pop=discord.Embed()
pop.set_image(url='https://sillygooselol.files.wordpress.com/2018/05/cropped-white-gooses.jpg')
sne=discord.Embed()
sne.set_image(url='https://previews.123rf.com/images/uken/uken1407/uken140700035/33222516-lovely-goose-peeping-sneaking-by.jpg')
danc=discord.Embed()
danc.set_image(url='https://media1.tenor.com/images/bbc0b37b24fe1695c86e72f56c6d4de9/tenor.gif?itemid=5453422')
jesus=discord.Embed()
jesus.set_image(url='https://i2.wp.com/media2.giphy.com/media/5DMqSvxOiGmKQ/giphy.gif')
mac=discord.Embed()
mac.set_image(url='https://i.redd.it/pvh86e0dhwv31.png')
#---------------------FUNCTIONS----------------------
users=[]
max=300
def assignhealth(member):
global users, max
if [str(member), max, 0, False, 'Alive'] not in users:
users.append([str(member), max, 0, False, 'Alive']) #[user, health, cp, dead?, status]
def checkifdead(victim):
global users
for i in range(len(users)):
if str(victim)==users[i][0] and users[i][1]<=0:
users[i][3]=True
users[i][1]=0
users[i][4]='Dead'
return True
#---------------------EVENTS----------------------
#send message when joined
@bot.event
async def on_guild_join(guild):
global users
if ['Mr.Goose ($)#8280', max, 0, False, 'Alive'] not in users:
users.append(['Mr.Goose ($)#8280', max, 0, False, 'Alive']) # since joining guild, doesn't append itself
await bot.change_presence(activity=discord.Game(name='Untitled Goose Game'))
general = find(lambda x: x.name == 'general', guild.text_channels)
if general and general.permissions_for(guild.me).send_messages:
await general.send('HONK HONK B*TCHES\n'
'Always nice to meet more ~~victims~~ friends :heart:\n')
for guild in bot.guilds:
for member in guild.members:
assignhealth(member)
print(users)
#alert when ready
@bot.event
async def on_ready():
#await bot.get_channel(735887013215076366).send("HONK activated")
print('Honk activated')
for guild in bot.guilds:
for member in guild.members:
assignhealth(member)
await bot.change_presence(activity=discord.Game(name='Untitled Goose Game'))
# we do not want the bot to reply to itself
@bot.event
async def on_message(message):
await bot.process_commands(message)
if message.author == bot.user:
return
#---------------------COMMANDS----------------------
bot.remove_command('help')
#$help
@bot.command(name='help')
async def help(ctx):
#await ctx.message.author.create_dm()
#await ctx.message.author.dm_channel.send(
# f'HONK HONK **{ctx.message.author.name}**!\n'
# f'Honk at <@!693860643203186808> for any inquiries.'
embedVar = discord.Embed(title="Mr.Goose Commands", description=" ", color=0xFF852D)
embedVar.add_field(name="$honk", value="honk and Mr.Goose will respond", inline=False)
embedVar.add_field(name="$mood", value="see Mr.Goose\'s current mood", inline=False)
embedVar.add_field(name="$army",
value="assemble your own goose army, must be done before attacking",
inline=False)
embedVar.add_field(name="$attack @user",
value="attack another user >:)", inline=False)
embedVar.add_field(name="$stats", value="check your stats", inline=False)
embedVar.add_field(name="$revive @user",
value="revive one of your dead friends... but only if you feel like it ;)",
inline=False)
embedVar.add_field(name="$rps rock/paper/scissors",
value="play rock paper scissors with a goose",
inline=False)
await ctx.send(embed=embedVar)
#!honk
@bot.command(name='honk', help='Mr. Goose responds to your honk.')
async def honking(ctx):
honkquotes = [
'H Ø Ñ K',
'........ʰᵒⁿᵏ?',
'ɥouʞ',
'ⓗⓞⓝⓚⓗⓞⓝⓚ',
'h̷̻͉̼̹̬͈̙͎͆̽̈́̈́͠͠o̸̻̞̯͐̈́̉̂͌͠ņ̶̨͓̰̝͈̼͉̲̒̄̌͜͝kh̷̻͉̼̹̬͈̙͎͆̽̈́̈́͠͠o̸̻̞̯͐̈́̉̂͌͠ņ̶̨͓̰̝͈̼͉̲̒̄̌͜͝kh̷̻͉̼̹̬͈̙͎͆̽̈́̈́͠͠o̸̻̞̯͐̈́̉̂͌͠ņ̶̨͓̰̝͈̼͉̲̒̄̌͜͝k̵̡͎̲̫̳͖̩̱̅̔̈́̿̽́̐͝',
':woman_fairy::sparkles: 𝒽𝓸𝓃𝓀 :rainbow::revolving_hearts:',
'(っ◔◡◔)っ ♥ honk ♥',
'hwoonnk :3',
'HONK (╯ ͠° ͟ʖ ͡°)╯┻━┻ HONK'
]
response = random.choice(honkquotes)
await ctx.send(response)
#$army
@bot.command(name='army', help='Assembles powerful goose army')
async def assemble(ctx):
global power, users
number = int(random.triangular(1,101,10))
person= str(ctx.message.author)
for i in range(len(users)):
if users[i][0]==person:
users[i][2]=number
print(users[i])
break
answer = "Assembled goose army of size "+str(number)+"!"
await ctx.send(answer+"\nready to ~~attack~~ send love")
#$stats
@bot.command(name='stats', help='Check\'s the user\'s stats.')
async def stats(ctx):
global users
for i in range(len(users)):
if str(ctx.message.author.name) in users[i][0]:
message = '**' + str(
ctx.message.author.name) + '\'s** stats:\nHealth: ' + str(users[i][1])+"/"+str(max)+"\nStrength: "+str(users[i][2])+"/100\nStatus: "+str(users[i][4])
await ctx.send(message)
break
#$attack
lefthealth=0
@bot.command(name='attack', help='Attacks the mentioned user with army previously generated.')
async def attack(ctx, member : discord.Member):
global lefthealth, users
for i in range(0,len(users)):
if users[i][0]==str(ctx.message.author):
say = "With the power of "+str(users[i][2])+" geese, \n"+str(ctx.message.author.mention)
break
attackquotes=[
" brutally attacked",
" knocked out",
" KO'd",
" clapped",
" destroyed",
" tackled",
" attacked"]
diequotes=[
" has been pecked to death by ",
" has died in the ~~hands~~ *wings* of "
]
for h in range(len(users)):
if str(ctx.message.author)==users[h][0] and users[h][2]==0: #if you dont have army
await ctx.send("HONK must assemble army first!")
break
elif str(member) == users[h][0] and users[h][3] == True: # if victim is already dead
await ctx.send(f'**{member.name}** is already dead :dizzy_face:')
break
elif str(ctx.message.author) == users[h][0] and users[h][3] == True: # if you attack when dead
await ctx.send(
'You silly goose! You can\'t attack when you\'re dead')
break
elif str(ctx.message.author)==users[h][0] and users[h][2]!=0: #if you have army
if str(member) == str(ctx.message.author): #if you attack yourself
await ctx.send("Stop it. Get some help.")
break
elif str(member) == "Mr.Goose ($)#8280": #if you attack the bot
await ctx.send(embed=uno)
await ctx.send(ctx.message.author.mention+" was killed by Mr. Goose.")
users[h][1]=0
users[h][3]=True
users[h][4]='Dead'
break
else: #you're allowed to attack
await ctx.send(say+random.choice(attackquotes)+" <@{}>:bangbang:".format(member.id))
for j in range(len(users)): #victim
for z in range(len(users)): #attacker
if str(member)==users[j][0] and str(ctx.message.author)==users[z][0]:
lefthealth=users[j][1]-users[z][2] #victims health - attackers cp
if lefthealth<=0:
lefthealth=0
users[j][1]=lefthealth #update victims hp
break
await ctx.send("<@{}> has ".format(member.id)+str(lefthealth)+"/"+str(max)+ " HP remaining.")
if checkifdead(member): #if victim is dead, let em know
await ctx.send("<@{}>".format(member.id) + random.choice(diequotes)+ str(
ctx.message.author.mention) + "'s army! :coffin:")
break
print(users)
print('-----------------------------------')
#$mood
@bot.command(name='mood', help='Shows Mr.Goose\'s mood')
async def mood(ctx):
moods=[['happy',hap, ' :)'],
['sad', sad, ' :('],
['angry', ang, ' >:('],
['shocked', shok, ' :o'],
['hungry', hung, ' :9'],
['VIOLENT', vio, ' >:0'],
['...horny', horn, ' ( ͡° ͜ʖ ͡°)'],
['gangsta', gang, ' :triumph::moneybag:'],
['lonely', lone, ' :\'('],
['popular', pop, ' :sunglasses:'],
['sneaky', sne, ' :*'],
['like dancing', danc, ' :▷'],
['like Jesus himself', jesus, ' :flushed:'],
['macho', mac, ' :muscle:']
]
select=random.randint(0,len(moods)-1)
await ctx.send('Mr. Goose is feeling **'+moods[select][0]+"**"+moods[select][2])
await ctx.send(embed=moods[select][1])
#$revive
@bot.command(name='revive', help='revive one of your dead friends... but only if you feel like it;)')
async def revive(ctx, member : discord.Member):
global users
for i in range(len(users)):
if str(member)==str(ctx.message.author):
await ctx.send('Honk!! That\'s illegal, beg a friend to help.')
break
else:
if str(member)==users[i][0] and users[i][1]==0:
users[i][1]=300
users[i][2]=0
users[i][3]=False
users[i][4]='Alive'
await ctx.send('With the power of :dizzy: 𝒻𝓇𝒾𝑒𝓃𝒹𝓈𝒽𝒾𝓅 🎀, <@{}> has been revived!'.format(member.id))
break
elif str(member)==users[i][0] and users[i][1]!=0:
await ctx.send(f'**{member.name}** is not dead! ʸᵉᵗ')
break
#$rps
@bot.command(name='rps', help='Play rock paper scissors with a goose.')
async def rps(ctx, play):
options=[['rock', 'paper', ' :punch:'], ['paper', 'scissors', ' :raised_hand:'], ['scissors', 'rock', ' :v:']] #[goose play, what defeats it]
pick = random.randint(0,2)
gplay = str(options[pick][0])
for i in range(0,len(options)):
if gplay==options[i][0] and str(play.lower())==options[i][1]:
await ctx.send(gplay+options[pick][2]+"\nhonk?? you win..")
break
elif gplay==options[i][1] and str(play.lower())==options[i][0]:
await ctx.send(gplay+options[pick][2]+"\nHONKK I WIN :crown: ")
break
elif gplay==str(play.lower()):
await ctx.send(gplay+options[pick][2]+'\n... a tie!')
break
keep_alive.keep_alive()
bot.run(TOKEN)