Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gipsy v1.5 #261

Merged
150 commits merged into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from 145 commits
Commits
Show all changes
150 commits
Select commit Hold shift + click to select a range
ebf1d95
:construction_worker: ci: add dependabot config
Aeris1One Mar 13, 2023
078c4ff
👷 ci: add docs dependencies to dependabot
Aeris1One Mar 14, 2023
a33b892
:see_no_evil: gitignore: add PyLint configuration to .gitignore
Aeris1One Feb 12, 2023
1a563fb
:art: style: fix style issues raised by PyLint in quizz plugin
Aeris1One Feb 12, 2023
36b8717
:art: style: fix style issues raised by PyLint in utils.py
Aeris1One Feb 12, 2023
5155c0d
:ambulance: Hopefully fix import error in quizz plugin
Aeris1One Feb 12, 2023
c47cbef
🕵 style: fix style issues in inviteTracker plugin
ascpial Feb 12, 2023
bb567bd
🚨 fix(antikikoo): linter warnings in antikikoo plugin
ascpial Feb 22, 2023
8acd072
🚨 fix(admin): fix pylint warnings
ascpial Feb 22, 2023
26f77a3
🚨 fix(ban): remove pylint warnings
ascpial Feb 22, 2023
90257cb
🚨 feat: add configuration for local modules
ascpial Feb 22, 2023
cb20ca4
🚨 fix(contact): linter warnings
ascpial Feb 22, 2023
3d20456
🚨 fix(generale): linter warnings
ascpial Feb 22, 2023
85aa4ba
🚨 fix(giveaways): linter warnings
ascpial Feb 22, 2023
d54d2df
🚨 fix(groups): litner warnings
ascpial Feb 22, 2023
1ca3289
🚨 fix(help): linter warnings
ascpial Feb 22, 2023
6b2ebd6
🚨 fix(hypesquad): fix linter warnings
ascpial Feb 22, 2023
b1690bb
🚨 fix(invitetracker): more love to the invitetracker plugin
ascpial Feb 22, 2023
ce230d5
🚨 fix(logs): remove linter warnings
ascpial Feb 22, 2023
037c06e
🚨 fix(messagemanager): fix linter warnings
ascpial Feb 22, 2023
44866d5
🚨 fix(misc): fix linter warnings
ascpial Feb 22, 2023
bdfc2a7
🚨 fix(rolelink): fix linter warnings
ascpial Feb 22, 2023
0216543
🚨 fix(rss): fix linter warnings
ascpial Feb 22, 2023
afde1a4
🚨 fix(thanks): fix linter warnings
ascpial Feb 23, 2023
6d2cdba
🚨 fix(voice): fix linter warnings
ascpial Feb 23, 2023
5375e87
🚨 fix(welcome): fix linter warnings
ascpial Feb 23, 2023
f25ddfe
🚨 fix(wormhole): fix linter warnings
ascpial Feb 23, 2023
08f5fd1
🚨 fix(xp): fix linter warnings
ascpial Feb 23, 2023
031938d
🚨 fix(core): remove linter warnings in core files
ascpial Feb 23, 2023
70f7488
🚨 fix(core): fix linter warnings for cogs
ascpial Feb 23, 2023
537046e
🚨 fix: various linter infos on all plugins
ascpial Feb 23, 2023
177200f
🚨 fix(docs): fix linter warnings in conf.py
ascpial Feb 23, 2023
16022de
Merge branch `beta` into `fix-style-issues`
ascpial Feb 23, 2023
abdd161
🚨 fix: fix last linter warnings
ascpial Feb 23, 2023
d7ade82
🩹 fix: some errors here and there
ascpial Feb 25, 2023
11ddcee
🚨 feat(perms+voice): last linter warnings
ascpial Mar 22, 2023
cf56eb4
🚨 fix(sconfig): linter warnings
ascpial Mar 22, 2023
ec2ce17
🔥 feat: remove unused test file
ascpial Mar 22, 2023
20fb0ca
🐛 fix: errors on launch
ascpial Mar 22, 2023
88d3f13
Merge pull request #116 from Gunivers/fix-style-issues
VForiel Mar 25, 2023
d515c94
💬 fix(voice): remove duplicated asterix names
Aeris1One Mar 27, 2023
39865ec
⬆️ deps: update discord-py requirement from ~=2.0.0 to ~=2.2.2
dependabot[bot] Mar 17, 2023
8005305
🐛 fix(messageManager): imitate doesn't work in threads
Aeris1One Apr 21, 2023
423482a
:fire: clean: remove useless condition leading to nothing
Aeris1One Apr 25, 2023
c51436d
🐛 fix: fix mandatory arguments being optionnal in `imitate`
Aeris1One Apr 25, 2023
3d36532
:sparkles: feat: prepare for slash commands
Aeris1One Apr 21, 2023
3b5c200
✨ feat: make errors ephemeral if triggered by slash command
Aeris1One Apr 21, 2023
5433f80
:bug: fix: use int for admin users in config setup
ZRunner Jun 4, 2023
d6f4c4b
:memo: feat: update funding url to our custom page
ZRunner Jun 4, 2023
2282cae
:arrow_up: deps:(deps): Update discord-py requirement from ~=2.2.2 to…
dependabot[bot] Jun 6, 2023
6214783
🐛 fix(help): help message not working (#210)
ascpial Jun 12, 2023
75067d0
:bug: fix(admin): loading/reloading cogs
ZRunner Jun 16, 2023
9ee156c
:bug: fix(admin): workspace cleanup
ZRunner Jun 16, 2023
5ffd8af
🐛 fix(logs): error with logs enable
ascpial Jun 16, 2023
958c5bd
:label: refact: i18n method typing
ZRunner Jun 4, 2023
1bd371c
:recycle: refact: giveaways cog typing
ZRunner Jun 4, 2023
ba76842
🚸 feat(slash): migrate giveaways to hybrid cmds
ZRunner Jun 10, 2023
7b92f24
:boom: refact(gaw): remove allowed emojis config
ZRunner Jun 10, 2023
dea50fa
:sparkles: feat(gaw): use buttons
ZRunner Jun 10, 2023
4a48c5b
✨ feat(bot): add get_command_mention method
ZRunner Jun 10, 2023
2448432
:recycle: feat(gaw): migrate to slash-only command
ZRunner Jun 10, 2023
5779ac6
🗃️ refact(gaw): remove useless SQL column
ZRunner Jun 10, 2023
004f22e
:bug: fix(gaw): end date calculation
ZRunner Jun 10, 2023
ee44e20
:art: refact(gaw): cleanup code and embeds
ZRunner Jun 16, 2023
e6c6317
:fire: refact(gaw): remove commented code
ZRunner Jun 16, 2023
2f234df
:globe_with_meridians: fix(gaw): missing translation
ZRunner Jun 16, 2023
511b059
🐛 fix(gaw): duplicated winners + buttons not removed
ZRunner Jun 16, 2023
0053300
✨ feat(gaw): autocompletion + more info
ZRunner Jun 16, 2023
70a0d4a
🐛 fix(gaw): missing french translation
ZRunner Jun 16, 2023
b4f8f31
🐛 fix(gaw): typing
ZRunner Jun 16, 2023
2140c04
:memo: fix(gaw): prefix documentation
ZRunner Jun 16, 2023
19ca39f
:recycle: refact(gaw): autocompletion methods
ZRunner Jun 16, 2023
281c6f2
🔊 feat: more consistent logs across the bot
ascpial Jun 17, 2023
1b65d1b
🔊 feat(perms): update logger
ascpial Jun 16, 2023
c689e38
🐛 fix: import were removed
ascpial Jun 16, 2023
efdcba5
🚨 fix: linter warnings for logging functions
ascpial Jun 17, 2023
0006c42
🚨 fix: remaining linter issues
ascpial Jun 17, 2023
2fab39d
🚨 fix: better practices
ascpial Jun 18, 2023
87ae103
:bug: fix(avatar): fix #191
ZRunner Jun 16, 2023
09f3044
:bug: fix(stats): fix #135
ZRunner Jun 16, 2023
17a0aa7
🐛 fix(admin): cleanup scope (#222)
ZRunner Jun 18, 2023
88adb1b
:bug: fix(help): wormhole default value repr
ZRunner Jun 16, 2023
d97a21c
🐛 fix(misc): cookie and hoster don't work in threads
ascpial Jun 18, 2023
ebce16c
🐛 fix(logger): traceback are now shown
ascpial Jun 18, 2023
71fefde
🐛 fix(roleLink): missing translations
ascpial Jun 18, 2023
83a896b
:bug: fix(rolelink): None in links list
ZRunner Jun 18, 2023
2b42c4d
:arrow_up: deps:(deps): update discord-py requirement
dependabot[bot] Jun 19, 2023
2f9bac5
:pencil2: fix(setup): typos in questions
ZRunner Jun 18, 2023
13a706a
:bug: fix(boot): token check in config
ZRunner Jun 18, 2023
34af4ea
:bug: fix(admin): add_cog/del_cog commands
ZRunner Jun 18, 2023
c0213f6
:arrow_up: deps:(deps): update discord-py requirement (#233)
dependabot[bot] Jul 3, 2023
3724a6a
:recycle: refact(wh): start cleaning code
ZRunner Jun 18, 2023
59fefaa
:bug: fix(wh): tenor updates
ZRunner Jun 18, 2023
9e8dc37
:recycle: refact(wh): message sending
ZRunner Jun 18, 2023
063aa7b
:recycle: refact(wh): misleading DB query
ZRunner Jun 18, 2023
86bff1d
:bug: fix(wh): too quick message edition
ZRunner Jun 18, 2023
afd1803
:recycle: refact(wh): comments and DB query
ZRunner Jun 18, 2023
476f3bf
✨ feat(wh): improve media embeds filter
ZRunner Jun 26, 2023
e92f917
:fire: fix(lint): remove unused import
ZRunner Jul 2, 2023
c4a1ddc
:recycle: refact(wh): code style
ZRunner Jul 3, 2023
f2efa4a
:bug: fix(wh): wrong channels count
ZRunner Jul 3, 2023
6a2493f
✨ feat(wh): use display name instead of username
ZRunner Jul 7, 2023
a8cc86e
🐛 fix(xp): configuration bug
ascpial Aug 30, 2023
93b99f3
:memo: docs: add star history to readme
Aeris1One Aug 3, 2023
586ba49
:arrow_up: deps:(deps): update discord-py requirement
dependabot[bot] Aug 30, 2023
d726e08
🐛 fix(channelArchive): fix missformed queries
ascpial Aug 30, 2023
27ea284
🚑️ hotfix: fix logging on Windows
Aeris1One Sep 12, 2023
4620fb2
✨ feat: add youtube tracking remover
Aeris1One Oct 31, 2023
2af1ed0
✨ feat(yt_tracking_rm): handle `t` and `time` parameters
Aeris1One Oct 31, 2023
9a0e00d
🐛 fix(yt_tracking_rm): fix `t` and `time`
Aeris1One Oct 31, 2023
e0ef633
🚨 linter(yt_tracking_rm): make pylint happy
Aeris1One Oct 31, 2023
1560017
✨ feat(yt_tracker_rm): add ability for a user to delete its own message
Aeris1One Oct 31, 2023
b99079d
🐛 fix(yt_tracker_rm): whoops, forgot to push language files
Aeris1One Oct 31, 2023
c438bd1
💡 comments(yt_tracker_rm): that's youtube tracking remover, not abbre…
Aeris1One Oct 31, 2023
f7a3421
🔥 fix(yt_tracking_rm): remove debug
Aeris1One Nov 1, 2023
03a04da
:lipstick: style(yt_tracking_rm): change "?" button from green to blue
Aeris1One Nov 2, 2023
0d965c5
:recycle: refactor(yt_tracking_rm): merge 'youtu.be' and 'youtube.com…
Aeris1One Nov 2, 2023
33ca7d7
:alien: fix(ban): new gif links & remove baldban
Aeris1One Nov 1, 2023
80fae88
:fire: rm(ban): remove baldban here as well
Aeris1One Nov 2, 2023
f0c0ccb
🔥 feat!(rss): remove twitter from the rss plugin
ascpial Aug 30, 2023
b159df8
🚨 fix(rss): remove warnings about unused variables
ascpial Aug 30, 2023
c915e52
:recycle: refactor(setup): rework boolean questions handling
Aeris1One Aug 31, 2023
597f76c
:adhesive_bandage: fix(setup): fix venv creation question
Aeris1One Aug 31, 2023
bea75dc
:adhesive_bandage: fix(setup): fix dependencies install outside of venv
Aeris1One Aug 31, 2023
8d06711
:heavy_plus_sign: deps: (re)add requests to dependencies
Aeris1One Nov 2, 2023
43b7633
:bug: fix(xp): cache access error + file lint
ZRunner Nov 2, 2023
2eb3f4b
:rotating_light: refact(lint): fix import order
ZRunner Nov 2, 2023
c32ed96
🌟 style: fix code style issues with Black
Nov 2, 2023
c8ee44d
:sparkles: feat: add heartbeat monitoring plugin
Aeris1One Nov 14, 2023
6ad1a7c
:goal_net: monitoring: better error handling
Aeris1One Nov 14, 2023
0527978
:sparkles: feat: add ping monitoring
Aeris1One Nov 14, 2023
273a7ce
:rotating_light: lint: use lazy formatting in logging
Aeris1One Nov 14, 2023
4dcb0c4
:goal_net: error: handle multiple errors
Aeris1One Nov 14, 2023
4b9b47f
:zap: perf: use persistant aiohttp session
Aeris1One Nov 14, 2023
27df5b9
:goal_net: error: raise error using "error" event & fix unnecessary e…
Aeris1One Nov 14, 2023
8036713
🌟 style: fix code style issues with Black
Nov 14, 2023
d9cccfc
:construction_worker: ci: add qodana
Aeris1One Nov 16, 2023
90781f6
🐛 fix(groups): correct variables refractor
ascpial Aug 30, 2023
d0598dd
fix: better code and linting
ascpial Nov 6, 2023
031910a
fix: linter warning
ascpial Nov 6, 2023
9fb7ada
🌟 style: fix code style issues with Black
Dec 12, 2023
81da976
🐛 fix(rss): cannot add and send web rss feed (#257)
ascpial Dec 20, 2023
9423065
🐛 fix(wormhole): spoiler and correct message deletion
ascpial Dec 27, 2023
da7e72a
🌟 style: fix code style issues with Black
Dec 27, 2023
e059159
:arrow_up: deps:(deps): update psutil requirement
dependabot[bot] Dec 18, 2023
177a47d
Merge branch 'master' into beta
Aeris1One Feb 20, 2024
eb4e956
🌟 style: fix code style issues with Black
Feb 20, 2024
ddeef21
:arrow_up: deps: update aiohttp requirement (#254)
dependabot[bot] Mar 12, 2024
4d0ed61
:arrow_up: deps: update psutil requirement (#260)
dependabot[bot] Mar 12, 2024
58edfd7
:arrow_up: deps: update aiohttp requirement (#262)
dependabot[bot] Mar 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
patreon: gunivers
custom: https://altearn.xyz/soutenir/
16 changes: 16 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: 2
updates:
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "weekly"
commit-message:
prefix: ":arrow_up: deps:"
include: "scope"
- package-ecosystem: "pip"
directory: "/docs"
schedule:
interval: "weekly"
commit-message:
prefix: ":arrow_up: docs:"
include: "scope"
19 changes: 19 additions & 0 deletions .github/workflows/qodana_code_quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Qodana
on:
workflow_dispatch:
pull_request:
push:
branches:
- monitoring

jobs:
qodana:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: 'Qodana Scan'
uses: JetBrains/[email protected]
env:
QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }}
4 changes: 4 additions & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[MASTER]

# resolve import issues for local modules
init-hook='import sys; sys.path.append(".")'
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,8 @@ Gipsy is modular, free and open-source Discord bot whose focus on accessibility

*This button redirect you to a more complete presentation with invitation links, list of features, self-hosting instructions and more.*

</div>
</div>

## Star History

[![Star History Chart](https://api.star-history.com/svg?repos=curiosity-org/gipsy&type=Date)](https://star-history.com/#curiosity-org/gipsy&Date)
2 changes: 1 addition & 1 deletion bot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
respectant les principes de diffusion des logiciels libres. Vous pouvez
utiliser, modifier et/ou redistribuer ce programme sous les conditions
de la licence CeCILL diffusée sur le site "http://www.cecill.info".
"""
"""
43 changes: 25 additions & 18 deletions bot/args.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,41 +5,44 @@
de la licence CeCILL diffusée sur le site "http://www.cecill.info".
"""

import discord
import re

from discord.ext import commands

from utils import MyContext


class tempdelta(commands.Converter):
async def convert(self, ctx: MyContext, argument: str) -> int:
d = 0
class tempdelta(commands.Converter): # pylint: disable=invalid-name
async def convert(
self, ctx: MyContext, argument: str

Check failure on line 17 in bot/args.py

View workflow job for this annotation

GitHub Actions / Pylint

bot/args.py#L17

Unused argument 'ctx' (unused-argument, W0613)
) -> int: # pylint: disable=unused-argument
time = 0
found = False
for x in [
for time_spec in [
("y", 86400 * 365),
("w", 604800),
("d", 86400),
("h", 3600),
("m", 60),
("min", 60),
]:
r = re.search(r"^(\d+)" + x[0] + "$", argument)
if r is not None:
d += int(r.group(1)) * x[1]
pattern = re.search(r"^(\d+)" + time_spec[0] + "$", argument)
if pattern is not None:
time += int(pattern.group(1)) * time_spec[1]
found = True
r = re.search(r"^(\d+)h(\d+)m?$", argument)
if r is not None:
d += int(r.group(1)) * 3600 + int(r.group(2)) * 60
pattern = re.search(r"^(\d+)h(\d+)m?$", argument)
if pattern is not None:
time += int(pattern.group(1)) * 3600 + int(pattern.group(2)) * 60
found = True
if not found:
raise commands.errors.BadArgument("Invalid duration: " + argument)
return d
return time


class moderatorFlag(commands.Converter):
class moderatorFlag(commands.Converter): # pylint: disable=invalid-name
async def convert(self, ctx: MyContext, argument: str) -> str:
LogsFlags = ctx.bot.get_cog("ConfigCog").LogsFlags.FLAGS
if argument not in LogsFlags.values():
logs_flags = ctx.bot.get_cog("ConfigCog").LogsFlags.FLAGS
if argument not in logs_flags.values():
raise commands.errors.BadArgument("Invalid moderation flag: " + argument)
return argument

Expand All @@ -48,15 +51,19 @@
class Constant(commands.Converter):
w = word

async def convert(self, ctx: MyContext, arg: str):
async def convert(
self, ctx: MyContext, arg: str
): # pylint: disable=unused-argument
if arg != self.w:
raise commands.errors.BadArgument("Unknown argument")

return Constant


class arguments(commands.Converter):
async def convert(self, ctx: MyContext, argument: str) -> dict:
class arguments(commands.Converter): # pylint: disable=invalid-name
async def convert(
self, ctx: MyContext, argument: str

Check failure on line 65 in bot/args.py

View workflow job for this annotation

GitHub Actions / Pylint

bot/args.py#L65

Unused argument 'ctx' (unused-argument, W0613)
) -> dict: # pylint: disable=unused-argument
answer = dict()
for result in re.finditer(r"(\w+) ?= ?\"((?:[^\"\\]|\\\"|\\)+)\"", argument):
answer[result.group(1)] = result.group(2).replace('\\"', '"')
Expand Down
9 changes: 6 additions & 3 deletions bot/checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"""

import discord

from utils import MyContext, CheckException
from core import config

Expand Down Expand Up @@ -48,9 +49,11 @@ async def is_roles_manager(ctx: MyContext):


async def can_group(ctx: MyContext):
config = ctx.bot.server_configs[ctx.guild.id]
if config["group_allowed_role"] is None:
server_config = ctx.bot.server_configs[ctx.guild.id]
if server_config["group_allowed_role"] is None:
return True
role = discord.utils.get(ctx.message.guild.roles, id=config["group_allowed_role"])
role = discord.utils.get(
ctx.message.guild.roles, id=server_config["group_allowed_role"]
)
if role in ctx.author.roles:
return True
40 changes: 20 additions & 20 deletions bot/utils/configManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,49 +7,49 @@

import os
from json import dump, load
from utils import Gunibot

from discord.ext import commands
from utils import CONFIG_OPTIONS

from utils import Gunibot, CONFIG_OPTIONS

CONFIG_FOLDER = "configs"

CONFIG_TEMPLATE = {k: v["default"] for k, v in CONFIG_OPTIONS.items() if "default" in v}


class serverConfig(dict):
def __init__(self, manager, serverID, value):
class ServerConfig(dict):
def __init__(self, manager, server_id, value):
super().__init__(value)
self.manager = manager
self.serverID = serverID
self.server_id = server_id

def __getitem__(self, key):
try:
return super().__getitem__(key)
except KeyError as e:
except KeyError as exc:
if key in CONFIG_TEMPLATE.keys():
return CONFIG_TEMPLATE[key]
raise e
raise exc

def __setitem__(self, key, item):
if key in CONFIG_TEMPLATE.keys():
super().__setitem__(key, item)
self.manager[self.serverID] = self
self.manager[self.server_id] = self
else:
raise ValueError("Invalid config key")

def __delitem__(self, key):
super().__setitem__(key, CONFIG_TEMPLATE[key])
self.manager[self.serverID] = self
self.manager[self.server_id] = self


class ConfigCog(commands.Cog):
def __init__(self, bot):
self.bot = bot
self.file = "configManager"
self.confManager = self.configManager()
self.conf_manager = self.ConfigManager()

class configManager(dict):
class ConfigManager(dict):
def __init__(self):
super().__init__()
self.cache = dict()
Expand All @@ -67,7 +67,7 @@ def __getitem__(self, key):
if not (isinstance(key, int) or key.isnumeric()):
raise ValueError("Key need to be a valid guild ID")
result = dict(CONFIG_TEMPLATE)
if key not in self.cache.keys():
if key not in self.cache:
try:
with open(f"{CONFIG_FOLDER}/{key}.json", "r", encoding="utf8") as f:
self.cache[key] = load(f)
Expand All @@ -76,7 +76,7 @@ def __getitem__(self, key):
result.update(self.cache[key])
allowed_keys = CONFIG_TEMPLATE.keys()
result = {k: v for k, v in result.items() if k in allowed_keys}
return serverConfig(self, key, result)
return ServerConfig(self, key, result)

def __repr__(self):
return "<configManager>"
Expand All @@ -95,11 +95,11 @@ def has_key(self, k):
def update(self, *args, **kwargs):
for arg in args:
if isinstance(arg, dict):
for k, v in arg.items():
self.__setitem__(k, v)
for key, value in arg.items():
self[key] = value
for kwarg in kwargs:
for k, v in kwarg.items():
self.__setitem__(k, v)
for key, value in kwarg.items():
self[key] = value

def keys(self):
return [name for name in os.listdir(CONFIG_FOLDER) if os.path.isfile(name)]
Expand Down Expand Up @@ -129,16 +129,16 @@ class LogsFlags:
1 << 8: "emojis",
}

def flagsToInt(self, flags: list) -> int:
def flags_to_int(self, flags: list) -> int:
r = 0
for k, v in self.FLAGS.items():
if v in flags:
r |= k
return r

def intToFlags(self, i: int) -> list:
def int_to_flags(self, i: int) -> list:
return [v for k, v in self.FLAGS.items() if i & k == k]


async def setup(bot: Gunibot = None, plugin_config: dict = None):
async def setup(bot: Gunibot = None):
await bot.add_cog(ConfigCog(bot))
Loading
Loading