log.debug('Was asked to play {} but no voice channel'.format(filename))
+ async def msg_say_channel(self, channel_name, text, guild):
+ channel = None
+ log.debug('Called say channel, trying to say "{}" in channel "{}" in guild {}'.format(text, channel_name, guild))
+ for c in self.text_channels:
+ if c.name == channel_name and (not guild or c.guild == guild):
+ log.debug('Found a text channel matching name {}'.format(c, type(c)))
+ channel = c
+ log.debug('Sending text now')
+ if channel is None:
+ raise Exception('No such channel found')
+ await channel.send(text)
+
+
async def msg_join_voice_channel(self, channel_name, guild):
log.debug('Called join voice channel, trying to join channel "{}" in guild {}'.format(channel_name, guild))
for vc in self.voice_channels:
log.info('Was instructed to join {} guild {}'.format(' '.join(message.content.split(' ')[1:]), str(guild)))
await self.msg_join_voice_channel(' '.join(message.content.split(' ')[1:]), guild=guild)
+ async def command_say(self, message, guild):
+ message_split = message.content.split(' ')
+ channel = message_split[1]
+ text = ' '.join(message_split[2:])
+ log.info('Was instructed to say {} in channel {} guild {}'.format(text, channel, str(guild)))
+ await self.msg_say_channel(channel, text, guild=guild)
+
+
async def command_play(self, message, guild):
horn = ' '.join(message.content.split(' ')[1:])
log.info('Was instructed to play {}'.format(horn))