Storycraft: notify (via privmsg) a player who has had a game newly assigned to them, and show the line.
This commit is contained in:
		
							parent
							
								
									487ca2e862
								
							
						
					
					
						commit
						2f001e274b
					
				| @ -434,8 +434,18 @@ class Storycraft(Module): | ||||
|                                             # indicate the status | ||||
|                                             game = self._get_game_details(game_id) | ||||
|                                             line = self._get_lines_for_game(game_id)[0] | ||||
|                                             last_line = self._get_lines_for_game(game_id)[1] | ||||
|                                             player = self._get_player_by_id(line.player_id) | ||||
| 
 | ||||
|                                             return_msg = 'Line logged.' | ||||
|                                             # message the new owner | ||||
|                                             if player.nick == nick: | ||||
|                                                 # simpily notify them they're up again | ||||
|                                                 return_msg = 'Line logged. Please add another.' | ||||
|                                             else: | ||||
|                                                 # notify the new owner, too | ||||
|                                                 self.irc.reply(connection, player.nick, 'You have a new line in storycraft #{0:d}: \'{1:s}\''.format(game_id, last_line.line)) | ||||
| 
 | ||||
|                                             # get the default settings | ||||
|                                             settings = self._get_storycraft_settings() | ||||
|                                             master_channel = settings.master_channel | ||||
| @ -443,7 +453,7 @@ class Storycraft(Module): | ||||
|                                             # log output | ||||
|                                             if game.status == 'IN PROGRESS': | ||||
|                                                 self.irc.reply(connection, master_channel, '{0:s} added a line to storycraft #{1:d}! - next player is {2:s}'.format(nick, game_id, player.nick)) | ||||
|                                                 return 'Line logged.' | ||||
|                                                 return return_msg | ||||
|                                             else: | ||||
|                                                 self.irc.reply(connection, master_channel, '{0:s} finished storycraft #{1:d}!'.format(nick, game_id)) | ||||
|                                                 return 'Line logged (and game completed).' | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user