WIP rehost stuff

This commit is contained in:
barelyprofessional
2026-02-05 23:26:46 -06:00
parent 477c121f72
commit 57e1b9c3b9
3 changed files with 10 additions and 1 deletions

View File

@@ -167,7 +167,6 @@ public class GetRandomImage : ICommand
public async Task RunCommand(ChatBot botInstance, MessageModel message, UserDbModel user, GroupCollection arguments,
CancellationToken ctx)
{
var logger = LogManager.GetCurrentClassLogger();
await using var db = new ApplicationDbContext();
var key = arguments["key"].Value.ToLower();
var images = db.Images.Where(i => i.Key == key);

View File

@@ -75,6 +75,11 @@ public static class Zipline
return url;
}
// public static async Task<string> RehostFile(string url)
// {
//
// }
public static async Task<bool> IsZiplineEnabled()
{
var key = await SettingsProvider.GetValueAsync(BuiltIn.Keys.ZiplineKey);

View File

@@ -512,6 +512,11 @@ public static class BuiltIn
public static string XeetEnabled = "Xeet.Enabled";
[BuiltInSetting("Connection string for bot's Redis", SettingValueType.Text)]
public static string BotRedisConnectionString = "Bot.RedisConnectionString";
[BuiltInSetting("Whether to automatically rehost images when they're added", SettingValueType.Boolean, "true",
BooleanRegex)]
public static string BotImageRehostEnabled = "Bot.Image.RehostEnabled";
[BuiltInSetting("Domain to look for when determining whether to rehost", SettingValueType.Text, "i.ddos.lgbt")]
public static string BotImageRehostDomain = "Bot.Image.RehostDomain";
}
}