mirror of
https://github.com/Jetsparrow/jetherald.git
synced 2026-01-21 07:56:09 +03:00
Turn GetTopicListing to ToString for Db.Topic
This commit is contained in:
parent
1fa9c14666
commit
bb226a9ece
@ -67,7 +67,7 @@ namespace JetHerald
|
|||||||
var topics = await db.GetTopicsForChat((long)ctx.Channel.Id, "Discord");
|
var topics = await db.GetTopicsForChat((long)ctx.Channel.Id, "Discord");
|
||||||
|
|
||||||
await ctx.RespondAsync(topics.Any()
|
await ctx.RespondAsync(topics.Any()
|
||||||
? "Topics:\n" + string.Join("\n", topics.Select(ListCommand.GetTopicListing))
|
? "Topics:\n" + string.Join("\n", topics)
|
||||||
: "No subscriptions active.");
|
: "No subscriptions active.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -20,12 +20,8 @@ namespace JetHerald
|
|||||||
var topics = await db.GetTopicsForChat(chatid, "Telegram");
|
var topics = await db.GetTopicsForChat(chatid, "Telegram");
|
||||||
|
|
||||||
return topics.Any()
|
return topics.Any()
|
||||||
? "Topics:\n" + string.Join("\n", topics.Select(GetTopicListing))
|
? "Topics:\n" + string.Join("\n", topics)
|
||||||
: "No subscriptions active.";
|
: "No subscriptions active.";
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static string GetTopicListing(Db.Topic t)
|
|
||||||
=> t.Name == t.Description ? t.Name : $"{t.Name}: {t.Description}";
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -25,6 +25,9 @@ namespace JetHerald
|
|||||||
|
|
||||||
public long? ChatId { get; set; }
|
public long? ChatId { get; set; }
|
||||||
public string Service { get; set; }
|
public string Service { get; set; }
|
||||||
|
|
||||||
|
public override string ToString()
|
||||||
|
=> Name == Description ? Name : $"{Name}: {Description}";
|
||||||
}
|
}
|
||||||
|
|
||||||
public class ExpiredTopicChat
|
public class ExpiredTopicChat
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user