mirror of
https://github.com/Ryubing/Ryuko.git
synced 2025-05-13 03:00:35 +01:00
parent
b363bcde56
commit
7c53993edd
1 changed files with 0 additions and 28 deletions
|
@ -1,6 +1,3 @@
|
|||
import json
|
||||
from typing import Any
|
||||
|
||||
import discord
|
||||
from discord.ext import commands
|
||||
from discord.ext.commands import Cog, Context, BucketType, Greedy
|
||||
|
@ -17,35 +14,10 @@ from robocop_ng.helpers.macros import (
|
|||
clear_aliases,
|
||||
)
|
||||
|
||||
from robocop_ng.__main__ import log
|
||||
|
||||
import os.path
|
||||
|
||||
|
||||
class Macro(Cog):
|
||||
|
||||
@staticmethod
|
||||
def import_volte_guild_data_tags(self):
|
||||
volte_data = self.bot.state_dir + "/../volteGuildData.json"
|
||||
if not os.path.exists(volte_data):
|
||||
return
|
||||
|
||||
loaded_guild_data: Any
|
||||
|
||||
with open(volte_data, "r") as f:
|
||||
loaded_guild_data = json.load(f)
|
||||
|
||||
tags = loaded_guild_data["extras"]["tags"]
|
||||
|
||||
for tag in tags:
|
||||
add_macro(self.bot, tag["name"], tag["content"])
|
||||
|
||||
os.remove(volte_data)
|
||||
|
||||
def __init__(self, bot):
|
||||
self.bot = bot
|
||||
Macro.import_volte_guild_data_tags(self)
|
||||
|
||||
|
||||
@commands.cooldown(3, 30, BucketType.user)
|
||||
@commands.command(aliases=["m"])
|
||||
|
|
Loading…
Reference in a new issue