async def cmd_galloadsettings(self, ctx): """ [Bot Owner] Loads gallery settings from the setup.ini file Useage: [prefix]galloadsettings """ config = Config() # ===== UPDATE THE SETTINGS IN THE LOCAL COG self.cogset['guild_id'] = config.target_guild_id self.cogset['enable']= config.galEnable self.cogset['channel_ids'] = config.gallerys["chls"] self.cogset['text_expirein']= config.gallerys['expire_in'] self.cogset['rem_low']= config.gallerys['rem_low'] self.cogset['user_wl']= config.gallerys["user_wl"] self.cogset['allow_links']= config.gallerys["links"] self.cogset['link_wl']= config.gallerys['link_wl'] # ===== SAVE COG SETTING await cogset.SAVE(self.cogset, cogname=self.qualified_name) # ===== RETURN await ctx.channel.send(content="Gallery information has been updated from the setup.ini file", delete_after=15) return
def __init__(self, bot): self.RafEntryActive = False self.RafDatetime = [] self.bot = bot self.config = Config() self.databaselg = DatabaseLogin() self.giveaway_role = None
async def cmd_galloadsettings(self, ctx): ###===== OPEN THE SETUP.INI FILE config = Config() ###===== WRITE DATA FROM THE SETUP.INI FILE TO THE DATABASE await self.db.execute(pgCmds.SET_GUILD_GALL_CONFIG, config.galEnable, config.gallerys["chls"], config.gallerys['expire_in'], config.gallerys["user_wl"], config.gallerys["links"], config.gallerys['link_wl']) ###===== UPDATE THE SETTINGS IN THE LOCAL COG self.gal_enable= config.galEnable guild = self.bot.get_guild(self.gal_guild_id) self.gal_channels= [channel for channel in guild.channels if channel.id in config.gallerys["chls"]] self.gal_text_expirein= config.gallerys['expire_in'] self.gal_user_wl= config.gallerys["user_wl"] self.gal_allow_links= config.gallerys["links"] self.gal_link_wl= config.gallerys['link_wl'] ###===== RETURN await ctx.channel.send(content="Gallery information has been updated from the setup.ini file", delete_after=15) return
def __init__(self, bot): self.bot = bot MemberDMS.config = Config() self.cogset = dict() self.db = None
def __init__(self, bot): self.bot = bot self.cogset = dict() self.report_ch = None DelMsgLogging.config = Config()
def __init__(self, bot): self.bot = bot self.cogset = dict() Giveaway.config = Config() self.giveaway_role = None
def __init__(self, bot): self.bot = bot Artists.config = Config()
def __init__(self, bot): self.bot = bot Fun.config = Config()
FurSail Invite URL: http://discord.gg/QMEgfcg Kind Regards -Lime """ import discord import datetime from functools import wraps from discord.ext import commands from collections.abc import Iterable from nuggetbot.util.chat_formatting import GUILD_URL_AS, AVATAR_URL_AS, RANDOM_DISCORD_COLOR from nuggetbot.config import Config config = Config() ########################################################################################### ###-------------------------------- COMMAND DECORATORS ---------------------------------### ########################################################################################### def CHANNEL(ch_id_names): """ Decorator for bot commands. Invoking msg must be sent in the channel/s provided Channel Limitations are overwritten if author is Staff | Admin | Guild Owner | Bot Owner Args: (str) Channel name (int) Channel ID (Iterable) Can be a mix of names and ids
def __init__(self, bot): self.bot = bot self.db = None self.cog_ready = False self.cogset = None GuildDB.config = Config()