Giter Site home page Giter Site logo

Delete Command issue about niles HOT 8 OPEN

reedbird8 avatar reedbird8 commented on May 27, 2024
Delete Command issue

from niles.

Comments (8)

reedbird8 avatar reedbird8 commented on May 27, 2024 1

So, this means it likely won't work for the time being and manually delete will be required?

from niles.

mchangrh avatar mchangrh commented on May 27, 2024

!delete has the following restrictions

  • within date threshold
  • matches stored event summary
  • cannot match by date/time

from niles.

mchangrh avatar mchangrh commented on May 27, 2024

relevant code

niles/handlers/commands.js

Lines 684 to 703 in db8ef87

function searchEventName(summary, guild, channel) {
// console log
console.log(`delete |${summary}|`);
listSingleEventsWithinDateRange(guild)
.then((resp) => {
console.log(typeof(resp.data));
if (!resp.data) return;
for (let curEvent of resp.data.items) {
console.log(`Summary |${curEvent.summary}|`);
if (curEvent.summary && summary.toLowerCase().trim() === curEvent.summary.toLowerCase().trim()) {
return curEvent;
}
}
}).catch((err) => {
log(`searchEventName | ${guild.id} | error ${err}`);
discordLog(err);
send(channel, i18n.t("deleteevent.error", {lng: guild.lng }));
});
//return false;
}

from niles.

reedbird8 avatar reedbird8 commented on May 27, 2024

That still doesn't help me figure out why it's not working.

If I have an event that was created with the command:

!create Test Event on Sept 25 at 4PM EDT

that then gives me an event with the name/summary "Test Event", shouldn't I be able to delete it with the following command:

!delete Test Event

from niles.

reedbird8 avatar reedbird8 commented on May 27, 2024

Sample image

image

from niles.

mchangrh avatar mchangrh commented on May 27, 2024

trying with debug, there was an issue a lot time ago with having spaces but that was resolved a while ago

from niles.

mchangrh avatar mchangrh commented on May 27, 2024

race condition, node isn't running it synchronously so I'll have to force an await

from niles.

mchangrh avatar mchangrh commented on May 27, 2024

forcing await is returning the missing argument error, will probably have to wait for the rewrite

from niles.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.