[REVERT]
Browse files
info.py
DELETED
|
@@ -1,43 +0,0 @@
|
|
| 1 |
-
import discord
|
| 2 |
-
from discord import app_commands #needed
|
| 3 |
-
import gradio_client
|
| 4 |
-
import gradio
|
| 5 |
-
from gradio_client import Client #needed
|
| 6 |
-
import os #needed
|
| 7 |
-
import threading #needed
|
| 8 |
-
import json #needed
|
| 9 |
-
import random #dfif
|
| 10 |
-
from PIL import Image #dfif
|
| 11 |
-
import asyncio #dfif
|
| 12 |
-
import glob #needed, dfif
|
| 13 |
-
|
| 14 |
-
# HF GUILD SETTINGS
|
| 15 |
-
MY_GUILD_ID = 1077674588122648679 if os.getenv("TEST_ENV", False) else 879548962464493619
|
| 16 |
-
MY_GUILD = discord.Object(id=MY_GUILD_ID)
|
| 17 |
-
HF_TOKEN = os.getenv('HF_TOKEN')
|
| 18 |
-
DISCORD_TOKEN = os.environ.get("DISCORD_TOKEN", None)
|
| 19 |
-
|
| 20 |
-
LOADING_EMOJI = '<a:loading:1121820108189339738>' if os.getenv("TEST_ENV", False) else '<a:loading:1114111677990981692>'
|
| 21 |
-
SUCCESS_EMOJI = '✅' if os.getenv("TEST_ENV", False) else '<:agree:1098629085955113011>'
|
| 22 |
-
FAILURE_EMOJI = '❌' if os.getenv("TEST_ENV", False) else '<:disagree:1098628957521313892>'
|
| 23 |
-
|
| 24 |
-
GUILD_ID = 1077674588122648679 if os.getenv("TEST_ENV", False) else 879548962464493619
|
| 25 |
-
FALCON_CHANNEL_ID = 1079459939405279232 if os.getenv("TEST_ENV", False) else 1119313248056004729
|
| 26 |
-
DEEPFLOYD_CHANNEL_ID = 1121834257959092234 if os.getenv("TEST_ENV", False) else 1119313215675973714
|
| 27 |
-
BOT_USER_ID = 1086256910572986469 if os.getenv("TEST_ENV", False) else 1102236653545861151
|
| 28 |
-
|
| 29 |
-
deepfloyd_client = Client("huggingface-projects/IF", HF_TOKEN)
|
| 30 |
-
falcon_client = Client("HuggingFaceH4/falcon-chat", HF_TOKEN)
|
| 31 |
-
|
| 32 |
-
class MyClient(discord.Client):
|
| 33 |
-
"""This structure allows commands to work instantly (instead of needing to sync global commands for up to an hour)"""
|
| 34 |
-
def __init__(self, *, intents: discord.Intents):
|
| 35 |
-
super().__init__(intents=intents)
|
| 36 |
-
self.tree = app_commands.CommandTree(self)
|
| 37 |
-
|
| 38 |
-
async def setup_hook(self):
|
| 39 |
-
# This copies the global commands over to our guild
|
| 40 |
-
self.tree.copy_global_to(guild=MY_GUILD)
|
| 41 |
-
await self.tree.sync(guild=MY_GUILD)
|
| 42 |
-
|
| 43 |
-
client = MyClient(intents=discord.Intents.default())
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|