Skip to content

vapor + swift discord = offline #73

@Chidorin

Description

@Chidorin

xcode + vapor 3.08 +swiftdiscord vapor branch
creating controller

class SwiftDiscordController: DiscordClientDelegate {
    var client: DiscordClient!

      func botstart(){
        client = DiscordClient(token: "Bot  sometoken", delegate: self, configuration: [.log(.info)])
        client.connect()
    }

    func client(_ client: DiscordClient, didConnect connected: Bool) {
        print("Bot connected!")
    }
    
    func client(_ client: DiscordClient, didCreateMessage message: DiscordMessage) {
        if message.content == "$mycommand" {
            message.channel?.send("I got your command")
        }
    }
}

in boot.swift boot func

   let sdc = SwiftDiscordController()
    sdc.botstart()`
the output is `Run[5716:7036429] LOG: DiscordWebSocketable: Connecting to wss://gateway.discord.gg/?v=6, shard: 0
2018-09-04 22:22:25.770318+0300 Run[5716:7036429] LOG: DiscordWebSocketable: Attaching WebSocket, shard: shard: 0

and some time later
2018-09-04 22:25:25.738707+0300 Run[5716:7047070] [BoringSSL] Function boringssl_session_errorlog: line 2881 [boringssl_session_read] SSL_ERROR_ZERO_RETURN(6): operation failed because the connection was cleanly shut down with a close_notify alert 2018-09-04 22:25:25.739887+0300 Run[5716:7047070] [BoringSSL] Function boringssl_session_errorlog: line 2881 [boringssl_session_read] SSL_ERROR_ZERO_RETURN(6): operation failed because the connection was cleanly shut down with a close_notify alert 2018-09-04 22:25:25.740186+0300 Run[5716:7047070] TIC Read Status [1:0x102732400]: 1:57 2018-09-04 22:25:25.740348+0300 Run[5716:7047070] TIC Read Status [1:0x102732400]: 1:57 2018-09-04 22:25:25.740428+0300 Run[5716:7047070] TIC Read Status [1:0x102732400]: 1:57
but i think that's xcode bug

bot is offline, can't figure out what is the cause the whole day

p.s. sorry if it is smth simple, the head just blowing what can it be
p.p.s token used as is, with bot/bearer; looks like it is auto changing with some time
also in discordoauth.swift baseURL = "https://discordapp.com/api/oauth2/ blank or token ending?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions