game_night.py 文件源码

python
阅读 17 收藏 0 点赞 0 评论 0

项目:goldmine 作者: Armored-Dragon 项目源码 文件源码
def topic(self, ctx, *, topic: str):
        """Start the current round with a topic."""
        or_check_perms(ctx, ['manage_guild', 'manage_channels', 'manage_messages', 'manage_roles'])
        if ctx.channel.id in self.games:
            try:
                await ctx.message.delete(reason='Deleting message sent to change the topic, so players don\'t see and prepare before the round')
            except discord.Forbidden:
                await ctx.send('? **I work best with the Manage Messages permission.**')
            game = self.games[ctx.channel.id]
            r_mention = game['r_mention']
            game['topic'] = topic
            await ctx.send('''Starting **round {}** in 30 seconds!
{}Get your butts in here, and grab your dankest memes!'''.format(str(game['round']), r_mention))
            await asyncio.sleep(28.6, loop=self.loop)
            game['active'] = True
            game['round_active'] = True
            await ctx.send(f'''{r_mention}The **meme war** is now starting for the topic `{topic}`!
Get your memes in already! :clap::clap:
Leaders: when you're ready, select a winner (and end the round) with `{ctx.prefix}gamenight winner`!''')
        else:
            await ctx.send(ctx.mention + ' There isn\'t a game night session in this channel!')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号