Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disocrd channels improvements #269

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

L-e-x-o-n
Copy link
Collaborator

  • Discord channels configs were removed from Discord site configs at teiserver/admin/site, they are now set at http://localhost:4000/admin/discord_channels (which is not a new thing but it was only used for a few channels before)
    Make sure to transfer any missing channel IDs from the old to new configs
  • All channel IDs are now read from the the new config when sending messages
  • Replaced usage of Nostrum.Api with Teiserver.Communication where possible Teiserver.Communication uses Nostrum.Api in the background. By using Teiserver.Communication everywhere it is easier to replace Nostrum.APi if it breaks in the future

@L-e-x-o-n L-e-x-o-n force-pushed the discord-mod-log-fix branch from 977e872 to b09b1d2 Compare April 17, 2024 16:00
Copy link
Contributor

@geekingfrog geekingfrog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I'm running the server with my discord config, I can send messages, but it seems there's one problem:

[error] Task #PID<0.2860.0> started from Teiserver.Bridge.DiscordBridgeBot terminating
** (ArgumentError) the Access calls for keywords expect the key to be an atom, got: 1238756874313011224
    (elixir 1.14.3) lib/access.ex:313: Access.get/3
    (teiserver 0.1.0) lib/teiserver/bridge/discord_bridge_bot.ex:47: Teiserver.Bridge.DiscordBridgeBot.handle_event/1
    (elixir 1.14.3) lib/task/supervised.ex:89: Task.Supervised.invoke_mfa/2
    (stdlib 4.2) proc_lib.erl:240: :proc_lib.init_p_do_apply/3
Function: #Function<5.64421518/0 in Teiserver.Bridge.DiscordBridgeBot.handle_info/2>
    Args: []

It seems the function bridge_channel_to_room does need some change as well.

# end
_ ->
nil
end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why the uncomment here? It seems this is going to override the response.
I'm not sure what is this textcb command, but at least it should be

    response = case data.name do
      "textcb" ->
        Teiserver.Bridge.TextcbCommand.execute(interaction, options_map)
      _ ->
        CommandLib.handle_command(interaction, options_map)
    end

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Text callbacks are the discord commands tha start with / and have autocomplete, for teiserver they return some premade responses on commonly asked questions. This isn't working for some reason so I was trying out different things.

type: "integer",
permissions: ["Admin"],
description: "The discord ID for the forum for starting GDT voting"
})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, that got me confused for a while trying to figure out where these things lived (or not actually).

@StanczakDominik StanczakDominik added the needs testing Needs unit tests or testing on integration server label May 28, 2024
@L-e-x-o-n L-e-x-o-n marked this pull request as draft August 7, 2024 16:48
@L-e-x-o-n L-e-x-o-n force-pushed the discord-mod-log-fix branch from b09b1d2 to 4595f5a Compare August 7, 2024 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs testing Needs unit tests or testing on integration server
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants