Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nightwolf93/night_DiscordVoice
A simple package with a discord bot for creating calls
https://github.com/nightwolf93/night_DiscordVoice
Last synced: 3 days ago
JSON representation
A simple package with a discord bot for creating calls
- Host: GitHub
- URL: https://github.com/nightwolf93/night_DiscordVoice
- Owner: nightwolf93
- Created: 2020-02-07T03:29:34.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-02-07T03:39:26.000Z (almost 5 years ago)
- Last Synced: 2024-08-03T16:14:59.189Z (3 months ago)
- Language: Lua
- Size: 6.84 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-onset - DiscordVoice - A simple package with a discord bot for creating calls. (Packages and Plugins / Libraries)
README
# night_DiscordVoice
A simple package with a discord bot for creating calls# How to use
Before you need to configure the bot in bot/index.js
You need to put the GuildId, CategoryId, and Token for the App.
You can start this bot in pm2 for example.# API
There is some functions available for creating callsBefore using it you need to import the package with
```
local discordVoice = ImportPackage("night_DiscordVoice")
```For begin the linking process just do something like that
```
AddCommand("discord", function(player, discordId)
AddPlayerChat(player, "Association en cours.. répondre au bot sur discord (30s)")
local discordVoice = ImportPackage("night_DiscordVoice")
if not discordVoice.IsAlreadyAssoc(tostring(GetPlayerSteamId(player))) then
discordVoice.AssertSteamIdWithDiscord(tostring(GetPlayerSteamId(player)), discordId)
else
AddPlayerChat(player, "Votre compte est déjà associé à Discord")
end
end)AddEvent("DiscordVoice:ResultAssert", function(result, steamId, discordId)
if result then
print("Association ok !")
else
print("Association failed !")
end
end)```
Create a call
```
discordVoice.CreateCall(discordVoice.GetDiscordIdBySteamId(tostring(GetPlayerSteamId(player))), discordVoice.GetDiscordIdBySteamId(call.to),
tostring(GetPlayerSteamId(player)), call.to)
```Delete a call
```
discordVoice.DeleteCall(call.id_call)
```