Skip to content

Commit 25c243b

Browse files
authored
Merge pull request #10 from PrototypeXenon/development
Fix issue #6
2 parents c9b9253 + 5fd594f commit 25c243b

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

protobot.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#####################################
2525
#
2626
COMMAND_PREFIX = '!' #
27-
VERSION = "v0.3.1-alpha" #
27+
VERSION = "v0.3.2-alpha" #
2828
ACTIVITY = discord.Game("!help") #
2929
LOG_LEVEL = logging.INFO #
3030
#
@@ -110,7 +110,7 @@ async def on_member_join(member):
110110
)
111111

112112
elif (member.guild.id == 720996920939642912):
113-
welcome_message = f"Welcome to the testing server, {member.name}!"
113+
welcome_message = f"Welcome to the ProtoBot development server, {member.name}!"
114114

115115
else:
116116
welcome_message = f"Welcome to {member.guild.name}, {member.name}!"
@@ -173,17 +173,18 @@ async def on_message(message):
173173
# await message.channel.send(response)
174174
# break
175175

176-
elif 'im' in message.content.lower() or 'i\'m' in message.content.lower() or 'i am' in message.content.lower():
176+
elif 'im' in message.content.lower() or 'i\'m' in message.content.lower() or 'i`m' in message.content.lower() or \
177+
'i‘m' in message.content.lower() or 'i´m' in message.content.lower() or 'i am' in message.content.lower():
177178
"""
178179
Lets the bot tell the famous "Hi x! I'm dad!" joke
179180
"""
180181

181182
user_message = message.content.split()
182183

183-
ways_to_say_i_am = [' im', ' i\'m']
184+
ways_to_say_i_am = [' im', ' i\'m', ' i´m', ' i`m', ' i‘m']
184185

185186
for i in range(len(user_message)):
186-
if (' ' + user_message[i].lower() in ways_to_say_i_am):
187+
if ' ' + user_message[i].lower() in ways_to_say_i_am:
187188

188189
if len(user_message) - i < 2:
189190
break
@@ -192,6 +193,14 @@ async def on_message(message):
192193
response = "Hi " + " ".join(user_message[i + 1:]) + "! I'm dad!"
193194
await message.channel.send(response)
194195
break
196+
197+
elif user_message[i].lower() == "i" and len(user_message) >= i:
198+
199+
if user_message[i + 1].lower() == "am":
200+
201+
response = "Hi " + " ".join(user_message[i + 2:]) + "! I'm dad!"
202+
await message.channel.send(response)
203+
break
195204

196205
await bot.process_commands(message)
197206

0 commit comments

Comments
 (0)