Skip to content

automatic reply chat with some respone #33

Answered by DeadLyBro
toastyy00 asked this question in Q&A
Discussion options

You must be logged in to vote

Index with Repeat;

{
    id()
    const userId = "" // Your user id here. Right click and click Copy id to get your id. 
    const search = ['GM','HI','HELLO']
    const channelId = cid
    let message = ['GM Fam','Hi there!','Welcome!']
    const seenMessagesIds = new Set()
    var loop = true
    var i = 0;
    const welcome = await api.sendMessage(channelId, 'Welcome to our server...')
    while (loop) {
        const messages = await api.getMessages(cid, null, {limit: 100, after: welcome.id}) // Limits to 100 messages and work after 'welcome' message. 
        const found = messages.filter(msg => msg.content.includes(search[i]) && !seenMessagesIds.has(msg.id) && msg.author.id != userId )

Replies: 3 comments 37 replies

Comment options

You must be logged in to vote
1 reply
@toastyy00
Comment options

Comment options

You must be logged in to vote
27 replies
@DeadLyBro
Comment options

@toastyy00
Comment options

@DeadLyBro
Comment options

@toastyy00
Comment options

@DeadLyBro
Comment options

Comment options

You must be logged in to vote
9 replies
@toastyy00
Comment options

@toastyy00
Comment options

@toastyy00
Comment options

@DeadLyBro
Comment options

@toastyy00
Comment options

Answer selected by toastyy00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants