[decorators] error messages and reacts, success reacts
Browse files
app.py
CHANGED
@@ -47,70 +47,97 @@ async def on_ready():
|
|
47 |
# jojo
|
48 |
@bot.command()
|
49 |
async def jojo(ctx):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
await thread.send(f'Here is the {style} version of it', file=discord.File(im))
|
61 |
-
else:
|
62 |
-
await ctx.message.reply("No attachments to be found...Can't animify dat! Try sending me an image π")
|
63 |
-
|
64 |
#----------------------------------------------------------------------------------------------------------------------------------------------
|
65 |
# Disney
|
66 |
@bot.command()
|
67 |
async def disney(ctx):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
await
|
78 |
-
|
79 |
-
|
80 |
|
81 |
#----------------------------------------------------------------------------------------------------------------------------------------------
|
82 |
# Spider-Verse
|
83 |
@bot.command()
|
84 |
async def spiderverse(ctx):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
85 |
|
86 |
-
if ctx.message.attachments:
|
87 |
-
thread = await ctx.message.create_thread(name=f'{ctx.author} Spider-Verse Thread... ')
|
88 |
-
await thread.send(f'{ctx.author.mention}Generating images in thread, can take ~1 minute...')
|
89 |
-
|
90 |
-
attachment = ctx.message.attachments[0]
|
91 |
-
style = 'Spider-Verse'
|
92 |
-
im = jojogan.predict(attachment.url, style)
|
93 |
|
94 |
-
await thread.send(f'Here is the {style} version of it', file=discord.File(im))
|
95 |
-
else:
|
96 |
-
await ctx.message.reply("No attachments to be found...Can't animify dat! Try sending me an image π")
|
97 |
|
98 |
#----------------------------------------------------------------------------------------------------------------------------------------------
|
99 |
# sketch
|
100 |
@bot.command()
|
101 |
async def sketch(ctx):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
102 |
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
await
|
112 |
-
else:
|
113 |
-
await ctx.message.reply("No attachments to be found...Can't animify dat! Try sending me an image π")
|
114 |
#----------------------------------------------------------------------------------------------------------------------------------------------
|
115 |
# Stage 1
|
116 |
@bot.command()
|
|
|
47 |
# jojo
|
48 |
@bot.command()
|
49 |
async def jojo(ctx):
|
50 |
+
try:
|
51 |
+
if ctx.message.attachments:
|
52 |
+
thread = await ctx.message.create_thread(name=f'{ctx.author} Jojo Thread...')
|
53 |
+
await thread.send(f'{ctx.author.mention}Generating images in thread, can take ~1 minute...yare yare, daze ...')
|
54 |
+
|
55 |
+
attachment = ctx.message.attachments[0]
|
56 |
+
style = 'JoJo'
|
57 |
+
im = jojogan.predict(attachment.url, style)
|
58 |
+
#await ctx.message.reply(f'Here is the {style} version of it', file=discord.File(im))
|
59 |
|
60 |
+
await thread.send(f'Here is the {style} version of it', file=discord.File(im))
|
61 |
+
await ctx.message.add_reaction('π')
|
62 |
+
else:
|
63 |
+
await ctx.message.reply("No attachments to be found...Can't animify dat! Try sending me an image π")
|
64 |
+
await ctx.message.add_reaction('β')
|
65 |
+
except Exception as e:
|
66 |
+
print(f"Error: {e}")
|
67 |
+
await ctx.reply('jojo error')
|
68 |
+
await ctx.message.add_reaction('β')
|
|
|
|
|
|
|
|
|
69 |
#----------------------------------------------------------------------------------------------------------------------------------------------
|
70 |
# Disney
|
71 |
@bot.command()
|
72 |
async def disney(ctx):
|
73 |
+
try:
|
74 |
+
if ctx.message.attachments:
|
75 |
+
thread = await ctx.message.create_thread(name=f'{ctx.author} Disney Thread... ')
|
76 |
+
await thread.send(f'{ctx.author.mention}Generating images in thread, can take ~1 minute...')
|
77 |
+
|
78 |
+
attachment = ctx.message.attachments[0]
|
79 |
+
style = 'Disney'
|
80 |
+
im = jojogan.predict(attachment.url, style)
|
81 |
|
82 |
+
await thread.send(f'Here is the {style} version of it', file=discord.File(im))
|
83 |
+
await ctx.message.add_reaction('π')
|
84 |
+
else:
|
85 |
+
await ctx.message.reply("No attachments to be found...Can't animify dat! Try sending me an image π")
|
86 |
+
await ctx.message.add_reaction('β')
|
87 |
+
except Exception as e:
|
88 |
+
print(f"Error: {e}")
|
89 |
+
await ctx.reply('disney error')
|
90 |
+
await ctx.message.add_reaction('β')
|
91 |
+
|
92 |
+
|
93 |
|
94 |
#----------------------------------------------------------------------------------------------------------------------------------------------
|
95 |
# Spider-Verse
|
96 |
@bot.command()
|
97 |
async def spiderverse(ctx):
|
98 |
+
try:
|
99 |
+
if ctx.message.attachments:
|
100 |
+
thread = await ctx.message.create_thread(name=f'{ctx.author} Spider-Verse Thread... ')
|
101 |
+
await thread.send(f'{ctx.author.mention}Generating images in thread, can take ~1 minute...')
|
102 |
+
|
103 |
+
attachment = ctx.message.attachments[0]
|
104 |
+
style = 'Spider-Verse'
|
105 |
+
im = jojogan.predict(attachment.url, style)
|
106 |
+
|
107 |
+
await thread.send(f'Here is the {style} version of it', file=discord.File(im))
|
108 |
+
await ctx.message.add_reaction('π')
|
109 |
+
else:
|
110 |
+
await ctx.message.reply("No attachments to be found...Can't animify dat! Try sending me an image π")
|
111 |
+
await ctx.message.add_reaction('β')
|
112 |
+
except Exception as e:
|
113 |
+
print(f"Error: {e}")
|
114 |
+
await ctx.reply('spiderverse error')
|
115 |
+
await ctx.message.add_reaction('β')
|
116 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
117 |
|
|
|
|
|
|
|
118 |
|
119 |
#----------------------------------------------------------------------------------------------------------------------------------------------
|
120 |
# sketch
|
121 |
@bot.command()
|
122 |
async def sketch(ctx):
|
123 |
+
try:
|
124 |
+
if ctx.message.attachments:
|
125 |
+
thread = await ctx.message.create_thread(name=f'{ctx.author} Sketch Thread... ')
|
126 |
+
await thread.send(f'{ctx.author.mention}Generating images in thread, can take ~1 minute...')
|
127 |
+
|
128 |
+
attachment = ctx.message.attachments[0]
|
129 |
+
style = 'sketch'
|
130 |
+
im = jojogan.predict(attachment.url, style)
|
131 |
|
132 |
+
await thread.send(f'Here is the {style} version of it', file=discord.File(im))
|
133 |
+
await ctx.message.add_reaction('π')
|
134 |
+
else:
|
135 |
+
await ctx.message.reply("No attachments to be found...Can't animify dat! Try sending me an image π")
|
136 |
+
await ctx.message.add_reaction('β')
|
137 |
+
except Exception as e:
|
138 |
+
print(f"Error: {e}")
|
139 |
+
await ctx.reply('sketch error')
|
140 |
+
await ctx.message.add_reaction('β')
|
|
|
|
|
141 |
#----------------------------------------------------------------------------------------------------------------------------------------------
|
142 |
# Stage 1
|
143 |
@bot.command()
|