mirror of
https://github.com/Matthww/TuneBot.git
synced 2026-09-21 21:27:48 +00:00
Migrated from keys to set datastructure in Redis
This commit is contained in:
@@ -1,11 +1,9 @@
|
||||
import asyncio
|
||||
from aioredis.client import Redis
|
||||
import discord
|
||||
from discord import ActivityType
|
||||
from discord.colour import Color
|
||||
from discord.ext import commands, tasks
|
||||
import sys
|
||||
from signal import SIGINT, SIGTERM
|
||||
import json
|
||||
from typing import Any, Dict, List, Sequence
|
||||
from discord import Message
|
||||
@@ -38,7 +36,6 @@ class ChristmasBot(commands.Bot):
|
||||
self.initial_cog_names: List[str] = self.config.get("cogs", [])
|
||||
self.colors: Dict[str, Color] = self.process_colours(config.get("colors", []))
|
||||
|
||||
|
||||
self._redis_client: Redis = aioredis.from_url(
|
||||
self.config["redis_url"], encoding="utf-8", decode_responses=True
|
||||
)
|
||||
@@ -110,6 +107,9 @@ class ChristmasBot(commands.Bot):
|
||||
await self.change_presence(activity=activity)
|
||||
|
||||
|
||||
config = json.load(open("config.json", "r", encoding="utf-8"))
|
||||
redis_prefix = config["redis_prefix"]
|
||||
|
||||
if __name__ == "__main__":
|
||||
try:
|
||||
import uvloop
|
||||
@@ -119,6 +119,5 @@ if __name__ == "__main__":
|
||||
except ModuleNotFoundError:
|
||||
pass
|
||||
|
||||
config = json.load(open("config.json", "r", encoding="utf-8"))
|
||||
token = config.pop("token")
|
||||
ChristmasBot(config).run(token, reconnect=True)
|
||||
|
||||
Reference in New Issue
Block a user