Skip to content

Commit

Permalink
Move to example config
Browse files Browse the repository at this point in the history
  • Loading branch information
MattBSG committed Jun 14, 2020
1 parent 488ba8b commit ce0aa20
Show file tree
Hide file tree
Showing 3 changed files with 114 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
bot/
.vscode/
*.json
config.py

# Byte-compiled / optimized / DLL files
__pycache__/
Expand Down
15 changes: 10 additions & 5 deletions bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,24 @@
import discord
from discord.ext import commands

import config
LOG_FORMAT = '%(levelname)s [%(asctime)s]: %(message)s'
logging.basicConfig(format=LOG_FORMAT, level=logging.INFO)

import utils

try:
import config

except ImportError:
logging.critical('[Bot] config.py does not exist, you should make one from the example config')

mclient = pymongo.MongoClient(
config.mongoHost,
username=config.mongoUser,
password=config.mongoPass
)
activityStatus = discord.Activity(type=discord.ActivityType.watching, name='over the server')
bot = commands.Bot(['!', ',', '.'], max_messages=300000, fetch_offline_members=True, activity=activityStatus, case_insensitive=True)

LOG_FORMAT = '%(levelname)s [%(asctime)s]: %(message)s'
logging.basicConfig(format=LOG_FORMAT, level=logging.INFO)
bot = commands.Bot(config.command_prefixes, max_messages=300000, fetch_offline_members=True, activity=activityStatus, case_insensitive=True)

class BotCache(commands.Cog):
def __init__(self, bot):
Expand Down
103 changes: 103 additions & 0 deletions config.example.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
token = 'token'
command_prefixes = ['!', ',', '.']

#Mongo Credentials
mongoUser = 'user'
mongoPass = 'password'
mongoHost = 'host'

mongoDealsUser = 'user'
mongoDealsPass = 'password'
mongoDealsHost = 'host'
mongoDealsPort = port
mongoDealsAuth = ''

# Users
parakarry = int: bot

# Guild IDs
nintendoswitch = int: guild

# Channel IDs
modChannel = int: modlog
logChannel = int: loglog
debugChannel = int: testing
adminChannel = int: admin
trialModChannel = int: trialmod
boostChannel = int: nitro booster
offclockChannel = int: admin offtopic id
switchHelp = int: switch help
spoilers = int: spoilers
suggestions = int: suggestions
voiceTextChannel = int: voice text
dealChannel = int: eshop deals
releaseChannel = int: new releases
smm2Channel = int: smm2
commandsChannel = int: commands
marioluigiChannel = int: mario and luigi
showModCTX = [debugChannel, adminChannel, offclockChannel, trialModChannel]

# Category IDs
eventCat = int: server events

# Role IDs
boostRole = int: nitro boosters
chatmod = int: chat moderator
submod = int: subreddit moderator
moderator = int: moderator
modemeritus = int: moderator emeritus
submodemeritus = int: sub moderator emeritus
eh = int: test server mod
helpfulUser = int: helpful user
warnTier1 = int: warning tier 1
warnTier2 = int: warning tier 2
warnTier3 = int: warning tier 3
mute = int: timeout
noSpoilers = int: spoiler restricted
noSuggestions = int: suggestion restricted
noEvents = int: event restricted
voiceTextAccess = int: voice chat

# Emoji IDs
loading = '<a:loading:659107120419045403>'
online = '<:online:319200223350095872>'
away = '<:away:319200276206845962>'
dnd = '<:dnd:319200300726616064>'
offline = '<:offline:319200260566286336>'
streaming = '<:streaming:469693769919234060>'
redTick = '<:redTick:402505117733224448>'
greenTick = '<:greenTick:402505080831737856>'
barChart = '<:barchart:612724385505083392>'
playButton = '▶'
nextTrack = '⏭'
fastForward = '⏩'
downTriangle = '🔻'
stopSign = '🛑'

# Web
baseUrl = 'https://example.com'
dealsAPI = 'https://example.net/api/games/switch'
dealsAPIKey = 'apikey'

# Text constants
punDM = 'You have received a moderation action on the /r/NintendoSwitch Discord server.\n' \
'Action: **{}**\n' \
'Reason:\n```{}```\n' \
'Responsible moderator: {}\n' \
'If you have questions concerning this matter, please feel free to contact the respective moderator that took this action or another member of the moderation team.\n\n' \
'Please do not respond to this message, I cannot reply.'

punStrs = {
'tier1': 'Tier 1 Warning',
'tier2': 'Tier 2 Warning',
'tier3': 'Tier 3 Warning',
'mute': 'Mute',
'unmute': 'Unmute',
'clear': 'Warnings reset',
'kick': 'Kick',
'ban': 'Ban',
'unban': 'Unban',
'blacklist': 'Blacklist',
'unblacklist': 'Unblacklist',
'note': 'Note'
}

0 comments on commit ce0aa20

Please sign in to comment.