You are browsing as a guest. Sign up (or log in) to start making projects!

My Slack Bot

  • 1 Devlogs
  • 2 Total hours

A Slack bot to do various tasks

Open comments for this post

1h 54m 31s logged

Devlog 1: didnt slack off

I have learnt a lot on this mission, including about bolt, more node js, and about ssh as well.\

What I have done

So far for this mission, I have done four commands:

  1. /m26-ping. It gets the latency of the bot. For this one I copy pasted it from the guide but I understand how it works. First it records the current time. Then, it acknowledges the command and when that’s done, it subtracts the current time from the previous time, giving it the latency.
  2. /m26-joke. It grabs a joke from the api: https://official-joke-api.appspot.com/random_joke. I also copy pasted this one. It uses axios to fetch a joke. Here’s a joke from the bot:
    Have you heard of the band 1023MB?
    They haven't got a gig yet.
  3. /m26-wordle. It gets the wordle answer of the day. I used the api: https://www.nytimes.com/svc/wordle/v2/YYYY-MM-DD.json. I made this one by myself. I have to fill in the dates, so I use this bit of code to get the date:
  const today = new Date();
  const yyyy = today.getFullYear();
  const mm = String(today.getMonth() + 1).padStart(2, '0');
  const dd = String(today.getDate()).padStart(2, '0');

Then I just fill in the blanks:

await axios.get(`https://www.nytimes.com/svc/wordle/v2/${yyyy}-${mm}-${dd}.json`)
  1. /m26-help This is the last and simplest one. It returns a fixed answer:
  await respond({
    text:
`Available Commands:
/m26-ping - Check bot latency
/m26-joke - Get a joke
/m26-wordle - Cheat at wordle`
  });

I think this might be the first and last devlog of this mission. Time to ship.

0
0
66

Delete project?

Are you sure you want to permanently delete this project? This action cannot be undone.

All devlogs, followers, and associated data will be removed.

Followers

Loading…