How to use the twitchio.ext.commands.cooldowns.Bucket function in twitchio

To help you get started, we’ve selected a few twitchio examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github TwitchIO / TwitchIO / twitchio / ext / commands / cooldowns.py View on Github external
def _bucket_keys(self, ctx):
        buckets = []

        for bucket in ctx.command._cooldowns:
            if bucket.bucket == Bucket.default:
                buckets.append('default')

            if bucket.bucket == Bucket.channel:
                buckets.append(ctx.channel.name)

            if bucket.bucket == Bucket.member:
                buckets.append((ctx.channel.name, ctx.author.id))
            if bucket.bucket == Bucket.user:
                buckets.append(ctx.author.id)

            if bucket.bucket == Bucket.subscriber:
                buckets.append((ctx.channel.name, ctx.author.id, 0))
            if bucket.bucket == Bucket.mod:
                buckets.append((ctx.channel.name, ctx.author.id, 1))

        return buckets
github TwitchIO / TwitchIO / twitchio / ext / commands / cooldowns.py View on Github external
def _bucket_keys(self, ctx):
        buckets = []

        for bucket in ctx.command._cooldowns:
            if bucket.bucket == Bucket.default:
                buckets.append('default')

            if bucket.bucket == Bucket.channel:
                buckets.append(ctx.channel.name)

            if bucket.bucket == Bucket.member:
                buckets.append((ctx.channel.name, ctx.author.id))
            if bucket.bucket == Bucket.user:
                buckets.append(ctx.author.id)

            if bucket.bucket == Bucket.subscriber:
                buckets.append((ctx.channel.name, ctx.author.id, 0))
            if bucket.bucket == Bucket.mod:
                buckets.append((ctx.channel.name, ctx.author.id, 1))

        return buckets
github TwitchIO / TwitchIO / twitchio / ext / commands / cooldowns.py View on Github external
for bucket in ctx.command._cooldowns:
            if bucket.bucket == Bucket.default:
                buckets.append('default')

            if bucket.bucket == Bucket.channel:
                buckets.append(ctx.channel.name)

            if bucket.bucket == Bucket.member:
                buckets.append((ctx.channel.name, ctx.author.id))
            if bucket.bucket == Bucket.user:
                buckets.append(ctx.author.id)

            if bucket.bucket == Bucket.subscriber:
                buckets.append((ctx.channel.name, ctx.author.id, 0))
            if bucket.bucket == Bucket.mod:
                buckets.append((ctx.channel.name, ctx.author.id, 1))

        return buckets
github TwitchIO / TwitchIO / twitchio / ext / commands / cooldowns.py View on Github external
def _bucket_keys(self, ctx):
        buckets = []

        for bucket in ctx.command._cooldowns:
            if bucket.bucket == Bucket.default:
                buckets.append('default')

            if bucket.bucket == Bucket.channel:
                buckets.append(ctx.channel.name)

            if bucket.bucket == Bucket.member:
                buckets.append((ctx.channel.name, ctx.author.id))
            if bucket.bucket == Bucket.user:
                buckets.append(ctx.author.id)

            if bucket.bucket == Bucket.subscriber:
                buckets.append((ctx.channel.name, ctx.author.id, 0))
            if bucket.bucket == Bucket.mod:
                buckets.append((ctx.channel.name, ctx.author.id, 1))

        return buckets
github TwitchIO / TwitchIO / twitchio / ext / commands / cooldowns.py View on Github external
def _bucket_keys(self, ctx):
        buckets = []

        for bucket in ctx.command._cooldowns:
            if bucket.bucket == Bucket.default:
                buckets.append('default')

            if bucket.bucket == Bucket.channel:
                buckets.append(ctx.channel.name)

            if bucket.bucket == Bucket.member:
                buckets.append((ctx.channel.name, ctx.author.id))
            if bucket.bucket == Bucket.user:
                buckets.append(ctx.author.id)

            if bucket.bucket == Bucket.subscriber:
                buckets.append((ctx.channel.name, ctx.author.id, 0))
            if bucket.bucket == Bucket.mod:
                buckets.append((ctx.channel.name, ctx.author.id, 1))

        return buckets
github TwitchIO / TwitchIO / twitchio / ext / commands / cooldowns.py View on Github external
def _bucket_keys(self, ctx):
        buckets = []

        for bucket in ctx.command._cooldowns:
            if bucket.bucket == Bucket.default:
                buckets.append('default')

            if bucket.bucket == Bucket.channel:
                buckets.append(ctx.channel.name)

            if bucket.bucket == Bucket.member:
                buckets.append((ctx.channel.name, ctx.author.id))
            if bucket.bucket == Bucket.user:
                buckets.append(ctx.author.id)

            if bucket.bucket == Bucket.subscriber:
                buckets.append((ctx.channel.name, ctx.author.id, 0))
            if bucket.bucket == Bucket.mod:
                buckets.append((ctx.channel.name, ctx.author.id, 1))

        return buckets