forked from adam/discord-bot-shtik
new feature: pulse check. also, assets folder
This commit is contained in:
parent
589d27434e
commit
d90123a56d
18
Features.cs
18
Features.cs
@ -18,6 +18,12 @@ namespace silverworker_discord
|
||||
public static Random r = new Random();
|
||||
public static async void detiktokify(Uri link, SocketUserMessage message)
|
||||
{
|
||||
//yes, even if there is a problem later.
|
||||
#pragma warning disable 4014
|
||||
message.AddReactionAsync(Emote.Parse("<:tiktok:1070038619584200884>"));
|
||||
#pragma warning restore 4014
|
||||
|
||||
|
||||
var ytdl = new YoutubeDLSharp.YoutubeDL();
|
||||
ytdl.YoutubeDLPath = "yt-dlp";
|
||||
ytdl.FFmpegPath = "ffmpeg";
|
||||
@ -33,7 +39,7 @@ namespace silverworker_discord
|
||||
await message.Channel.SendMessageAsync("tried to dl, failed. \n" + string.Join('\n', res.ErrorOutput));
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
string path = res.Data;
|
||||
if (File.Exists(path))
|
||||
{
|
||||
@ -147,7 +153,7 @@ namespace silverworker_discord
|
||||
}
|
||||
public static async void Joke(SocketUserMessage message)
|
||||
{
|
||||
var jokes = File.ReadAllLines("jokes.txt");
|
||||
var jokes = File.ReadAllLines("assets/jokes.txt");
|
||||
jokes = jokes.Where(l => !string.IsNullOrWhiteSpace(l))?.ToArray();
|
||||
if(jokes?.Length == 0){
|
||||
await message.Channel.SendMessageAsync("I don't know any. Adam!");
|
||||
@ -183,13 +189,13 @@ namespace silverworker_discord
|
||||
{
|
||||
switch (r.Next(5))
|
||||
{
|
||||
case 0:
|
||||
await message.Channel.SendFileAsync("./coding and algorithms.png", "i am actually niether neural-net processor nor a learning computer. but I do use **coding** and **algorithms**.");
|
||||
default:
|
||||
await message.Channel.SendFileAsync("assets/coding and algorithms.png", "i am actually niether neural-net processor nor a learning computer. but I do use **coding** and **algorithms**.");
|
||||
break;
|
||||
case 1:
|
||||
case 4:
|
||||
await message.AddReactionAsync(new Emoji("\U0001F644")); //eye roll emoji
|
||||
break;
|
||||
case 2:
|
||||
case 5:
|
||||
await message.AddReactionAsync(new Emoji("\U0001F611")); //emotionless face
|
||||
break;
|
||||
}
|
||||
|
0
Jenkinsfile
vendored
Normal file
0
Jenkinsfile
vendored
Normal file
@ -204,6 +204,10 @@ namespace silverworker_discord
|
||||
{
|
||||
Features.Joke(message);
|
||||
}
|
||||
if (Regex.IsMatch(msgText, "!pulse ?check\\b"))
|
||||
{
|
||||
message.Channel.SendFileAsync("assets/ekgblip.png");
|
||||
}
|
||||
if (msgText.Contains("cognitive dissonance") == true)
|
||||
{
|
||||
message.ReplyAsync("that's not what cognitive dissonance means. Did you mean \"hypocrisy\"?");
|
||||
|
Before Width: | Height: | Size: 293 KiB After Width: | Height: | Size: 293 KiB |
Before Width: | Height: | Size: 107 KiB After Width: | Height: | Size: 107 KiB |
BIN
assets/ekgblip.png
Normal file
BIN
assets/ekgblip.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 16 KiB |
@ -19,10 +19,10 @@
|
||||
<None Update="AppSettings.json">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="jokes.txt">
|
||||
<None Update="assets/jokes.txt">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="coding and algorithms.png">
|
||||
<None Update="assets/coding and algorithms.png">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
Loading…
Reference in New Issue
Block a user