Skip to content

Commit a01aff7

Browse files
committed
tiny fix
1 parent d19f99d commit a01aff7

File tree

3 files changed

+31
-31
lines changed

3 files changed

+31
-31
lines changed

rotations/friday_8

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
Super Street Fighter II Turbo
21
The King of Fighters '98
32
Samurai Shodown II
43
Garou: Mark of the Wolves
54
The Last Blade 2
65
Waku Waku 7
76
Vampire Savior
7+
Super Street Fighter II Turbo

rotations/saturday_8

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
JoJo's Bizarre Adventure
21
Street Fighter V
32
The King of Fighters 2002
43
Street Fighter III 3rd Strike: Fight for the Future
4+
JoJo's Bizarre Adventure

sfcjbot.py

+29-29
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ async def on_message(message):
1818
return
1919

2020
# When's Mahvel? March 7th.
21-
if "when's mahvel" in message.content or "whens mahvel" in message.content:
21+
if "when's mahvel" in message.content.lower() or "whens mahvel" in message.content.lower() or "when is mahvel" in message.content.lower():
2222
time_to_marvel = marvel_release_date - datetime.date.today()
2323
await client.send_message(message.channel, message.author.mention + ", Ultimate Marvel vs Capcom 3 releases for PC on March 7, which is in " + str(time_to_marvel.days) + " days.")
2424
return
@@ -44,19 +44,19 @@ async def on_message(message):
4444
print(time+": failed to set "+message.author.name+" to here.")
4545
await client.send_message(message.author, "I was unable to set your status to here. Please ask Chish#2578 to check the logs at time "+time)
4646
return
47-
print(str(datetime.now())+": set "+message.author.name+" to here.")
47+
print(str(datetime.datetime.now())+": set "+message.author.name+" to here.")
4848
await client.send_message(message.author, "Your status was changed to 'here.'")
4949
return
5050

5151
if "afk" in command.lower() or "away" in command.lower():
5252
await add_new_user_if_needed(message)
5353
result = await db_wrapper.execute(client, message.author, "UPDATE users SET status='afk' WHERE discord_id="+message.author.id, False)
5454
if result is None:
55-
time = str(datetime.now())
55+
time = str(datetime.datetime.now())
5656
print(time+": failed to set "+message.author.name+" to away.")
5757
await client.send_message(message.author, "I was unable to set your status to afk. Please ask Chish#2578 to check the logs at time "+time)
5858
return
59-
print(str(datetime.now())+": set "+message.author.name+" to afk.")
59+
print(str(datetime.datetime.now())+": set "+message.author.name+" to afk.")
6060
await client.send_message(message.author, "Your status was changed to 'afk.'")
6161
return
6262

@@ -118,7 +118,7 @@ async def addgame(game_to_add, message):
118118
if message.author.permissions_in(message.channel).kick_members:
119119
add_game="INSERT INTO games (game) VALUES ('"+game_to_add+"')"
120120
await db_wrapper.execute(client, message.author, add_game, True)
121-
print(str(datetime.now())+": added game "+game_to_add)
121+
print(str(datetime.datetime.now())+": added game "+game_to_add)
122122
await client.send_message(message.author, "added game "+game_to_add+". If you messed up, ping Chish#2578!")
123123
else:
124124
await client.send_message(message.author, "You don't have permission to add games.")
@@ -128,19 +128,19 @@ async def add_new_user_if_needed(message):
128128
#This method also catches nickname changes (with the lower part there)
129129
search_for_user = "SELECT discord_id FROM users WHERE discord_id='"+message.author.id+"'"
130130
result = await db_wrapper.execute(client, message.author, search_for_user, True)
131-
#print(str(datetime.now())+" add_new_user_if_needed found user: "+str(result))
131+
#print(str(datetime.datetime.now())+" add_new_user_if_needed found user: "+str(result))
132132
if str(result) == "()":
133133
await db_wrapper.execute(client, message.author, "INSERT INTO users (discord_id) VALUES ('"+message.author.id+"')", True)
134-
print(str(datetime.now())+": added user: "+message.author.id+" ("+message.author.name+")")
134+
print(str(datetime.datetime.now())+": added user: "+message.author.id+" ("+message.author.name+")")
135135
await db_wrapper.execute(client, message.author, "UPDATE users SET username='"+message.author.name+"' WHERE discord_id='"+message.author.id+"'", True)
136-
print(str(datetime.now())+": set discord_id "+message.author.id+" to username "+message.author.name)
136+
print(str(datetime.datetime.now())+": set discord_id "+message.author.id+" to username "+message.author.name)
137137
return
138138
search_for_user = "SELECT username FROM users WHERE discord_id='"+message.author.id+"'"
139139
result = await db_wrapper.execute(client, message.author, search_for_user, True)
140-
print(str(datetime.now())+": " + str(result[0][0]) + " already exists in the DB.")
140+
print(str(datetime.datetime.now())+": " + str(result[0][0]) + " already exists in the DB.")
141141
if str(result[0][0]) != message.author.name:
142142
await db_wrapper.execute(client, message.author, "UPDATE users SET username='"+message.author.name+"' WHERE discord_id='"+message.author.id+"'", True)
143-
print(str(datetime.now())+": discord_id "+message.author.id+" changed to username "+message.author.name)
143+
print(str(datetime.datetime.now())+": discord_id "+message.author.id+" changed to username "+message.author.name)
144144
return
145145

146146
async def describe(message):
@@ -168,7 +168,7 @@ async def describe(message):
168168
if user_description_tuple[2]:
169169
user_description += " Their CFN is " + user_description_tuple[2] + "."
170170
await client.send_message(message.author, user_description)
171-
print(str(datetime.now())+": gave " + discord_user + "'s description to " + message.author.name + ".")
171+
print(str(datetime.datetime.now())+": gave " + discord_user + "'s description to " + message.author.name + ".")
172172
return
173173

174174

@@ -204,9 +204,9 @@ async def is_member_queued_for_game(member, game):
204204
query = "SELECT UID FROM pools WHERE game='"+game.replace("'","''")+"' AND player='"+member.id+"'"
205205
dbresult = await db_wrapper.execute(client, member, query, True)
206206
if str(dbresult) != "()":
207-
print(str(datetime.now())+": "+member.name+" was found to be queued for "+game)
207+
print(str(datetime.datetime.now())+": "+member.name+" was found to be queued for "+game)
208208
return True
209-
print(str(datetime.now())+": "+member.name+" was found to NOT be queued for "+game)
209+
print(str(datetime.datetime.now())+": "+member.name+" was found to NOT be queued for "+game)
210210
return False
211211

212212
async def match(message):
@@ -216,7 +216,7 @@ async def match(message):
216216
return
217217
get_players_marked_here = "SELECT discord_id, username FROM users JOIN pools WHERE discord_id = player AND game = (SELECT DISTINCT game FROM games WHERE game = '"+hopefully_a_game.replace("'","''")+"' OR ALIAS = '"+hopefully_a_game.replace("'","''")+"') AND status='here' AND discord_id <> '"+message.author.id+"'"
218218
results = await db_wrapper.execute(client, message.author, get_players_marked_here, True)
219-
print(str(datetime.now())+": "+message.author.name+" requested a match in "+hopefully_a_game+" and found: "+str(results))
219+
print(str(datetime.datetime.now())+": "+message.author.name+" requested a match in "+hopefully_a_game+" and found: "+str(results))
220220
if results is None:
221221
await client.send_message(message.channel, 'Sorry, I couldn\'t find a match for you.\nDed gaem lmao')
222222
return
@@ -234,7 +234,7 @@ async def match(message):
234234

235235
challenge_message = 'Hey, ' + ", ".join(mentions_list) +' let\'s play some '+hopefully_a_game+' with '+message.author.mention
236236
await client.send_message(message.channel, challenge_message)
237-
print(str(datetime.now())+": final match list for "+hopefully_a_game+": "+", ".join(usernames_list))
237+
print(str(datetime.datetime.now())+": final match list for "+hopefully_a_game+": "+", ".join(usernames_list))
238238
return
239239

240240
async def match_random_game(message):
@@ -261,24 +261,24 @@ async def match_random_game(message):
261261
games_to_players[game]=players
262262
# Now we have a map of {games the user is queued for, all other matched players}
263263
# We choose a random game (that actually has players) and match for that game.
264-
#print(str(datetime.now())+": games_to_players: "+str(games_to_players))
264+
#print(str(datetime.datetime.now())+": games_to_players: "+str(games_to_players))
265265
if len(games_to_players.keys()) == 0:
266-
print(str(datetime.now())+": failed to find a random game for "+message.author.name+".")
266+
print(str(datetime.datetime.now())+": failed to find a random game for "+message.author.name+".")
267267
await client.send_message(message.channel, "Sorry, I couldn't find a match for you.")
268268
return
269269
chosen_game=random.choice(list(games_to_players.keys()))
270270
while (len(games_to_players[chosen_game]) == 0):
271271
del games_to_players[chosen_game]
272272
if len(games_to_players.keys()) == 0:
273-
print(str(datetime.now())+": failed to find a random game for "+message.author.name+".")
273+
print(str(datetime.datetime.now())+": failed to find a random game for "+message.author.name+".")
274274
await client.send_message(message.channel, "Sorry, I couldn't find a match for you.")
275275
return
276276
chosen_game=random.choice(list(games_to_players.keys()))
277-
print(str(datetime.now())+": randomly matched "+message.author.name+" in "+chosen_game+" with "+str(games_to_players[chosen_game]))
277+
print(str(datetime.datetime.now())+": randomly matched "+message.author.name+" in "+chosen_game+" with "+str(games_to_players[chosen_game]))
278278
challenge_message = 'Hey, ' + ", ".join(games_to_players[chosen_game]) +' let\'s play some '+chosen_game+' with '+message.author.mention
279279
await client.send_message(message.channel, challenge_message)
280280
else:
281-
print(str(datetime.now())+": "+message.author.name+" tried to match a random game, but wasn't queued for anything.")
281+
print(str(datetime.datetime.now())+": "+message.author.name+" tried to match a random game, but wasn't queued for anything.")
282282
await client.send_message(message.channel, "You'll have to queue up for some games before I can match you, "+message.author.mention)
283283
return
284284

@@ -306,7 +306,7 @@ async def pairing(message):
306306
else:
307307
# TODO Regular version of command. Only ping the person who asked.
308308
discord_output = "Sorry, only mods are allowed to do that for now."
309-
print(str(datetime.now())+": gave pairings to " + message.author.name)
309+
print(str(datetime.datetime.now())+": gave pairings to " + message.author.name)
310310
if discord_output == "":
311311
discord_output = "I don't have any tournaments running right now."
312312
await client.send_message(message.channel, discord_output)
@@ -322,14 +322,14 @@ async def queue(message, command):
322322
already_queued = await is_member_queued_for_game(message.author, game)
323323
if not already_queued:
324324
await db_wrapper.execute(client, message.author, "INSERT INTO pools (game, player) VALUES ('"+game.replace("'","''")+"', '"+message.author.id+"')", True)
325-
print(str(datetime.now())+": added "+message.author.name+" to the queue for "+game)
325+
print(str(datetime.datetime.now())+": added "+message.author.name+" to the queue for "+game)
326326
await client.send_message(message.author, "Added you to the queue for " + hopefully_game)
327327
else:
328-
print(str(datetime.now())+": "+message.author.name+" was already queued for "+game)
328+
print(str(datetime.datetime.now())+": "+message.author.name+" was already queued for "+game)
329329
await client.send_message(message.author, "You're already queued up for "+hopefully_game+".")
330330
else:
331331
await client.send_message(message.author, "I\'ve never heard of a game called " + hopefully_game)
332-
print(str(datetime.now())+": "+message.author.name+" searched for "+hopefully_game+" but found nothing.")
332+
print(str(datetime.datetime.now())+": "+message.author.name+" searched for "+hopefully_game+" but found nothing.")
333333
return
334334

335335
async def set_secondary(message, thing_to_set):
@@ -341,18 +341,18 @@ async def set_secondary(message, thing_to_set):
341341
query = "UPDATE users SET " + thing_to_set + " = '" + hopefully_a_valid_input + "' WHERE discord_id = '" + message.author.id + "'"
342342
result = await db_wrapper.execute(client, message.author, query, True)
343343
if result is None:
344-
time = str(datetime.now())
344+
time = str(datetime.datetime.now())
345345
print(time+": failed to set "+message.author.name+"'s " + thing_to_set + " to "+hopefully_a_valid_input+".")
346346
await client.send_message(message.author, "I was unable to set your " + thing_to_set +". Please ask Chish#2578 to check the logs at time "+time)
347347
return
348-
print(str(datetime.now())+": Set " + message.author.name + "'s " + thing_to_set + " to " + hopefully_a_valid_input)
348+
print(str(datetime.datetime.now())+": Set " + message.author.name + "'s " + thing_to_set + " to " + hopefully_a_valid_input)
349349
await client.send_message(message.author, "Set your " + thing_to_set + " to " + hopefully_a_valid_input+".")
350350
return
351351

352352
async def tell_aliases(message):
353353
# aquire map of (full game name) to (list of all aliases for that game)
354354
sql_games_and_aliases = await db_wrapper.execute(client, message.author, "SELECT game, alias FROM games ORDER BY game", True)
355-
#print(str(datetime.now())+ ": games and aliases: "+str(sql_games_and_aliases))
355+
#print(str(datetime.datetime.now())+ ": games and aliases: "+str(sql_games_and_aliases))
356356
game_alias_map = {}
357357
for game_alias_pair in sql_games_and_aliases:
358358
if game_alias_pair[0] in game_alias_map:
@@ -374,7 +374,7 @@ async def tell_aliases(message):
374374
readable_aliases = readable_aliases[:-2] # there are no aliases left, so remove that last comma + space
375375
readable_aliases += "\n"
376376

377-
print(str(datetime.now())+ ": gave game/alias map to "+str(message.author.name))
377+
print(str(datetime.datetime.now())+ ": gave game/alias map to "+str(message.author.name))
378378
await client.send_message(message.author, "Here are all the aliases available for games I have available: \n" + readable_aliases)
379379
return
380380

@@ -387,7 +387,7 @@ async def unqueue(message, command):
387387
already_queued = await is_member_queued_for_game(message.author, game[0][0])
388388
if already_queued:
389389
await db_wrapper.execute(client, message.author, "DELETE FROM pools WHERE game='"+game[0][0].replace("'","''")+"' AND player='"+message.author.id+"'", True)
390-
print(str(datetime.now())+": removed "+message.author.name+" from the queue for "+game[0][0])
390+
print(str(datetime.datetime.now())+": removed "+message.author.name+" from the queue for "+game[0][0])
391391
await client.send_message(message.author, "Removed you from the queue for "+hopefully_game)
392392
else:
393393
await client.send_message(message.author, "You aren't in the queue for "+hopefully_game)

0 commit comments

Comments
 (0)