FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
NotaBot/module_game.lua at master · DigitalPulseSoftware/NotaBot · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
DigitalPulseSoftware
/
NotaBot
Public
Notifications
You must be signed in to change notification settings
Fork
13
Star
25
Code
Issues
13
Pull requests
9
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
NotaBot
/
module_game.lua
Copy path
More file actions
More file actions
Latest commit
History
History
History
47 lines (39 loc) · 947 Bytes
Breadcrumbs
NotaBot
/
module_game.lua
Copy path
File metadata and controls
47 lines (39 loc) · 947 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
--
Copyright (C) 2018 Jérôme Leclercq
--
This file is part of the "Not a Bot" application
--
For conditions of distribution and use, see copyright notice in LICENSE
local
bot
=
Bot
local
client
=
Client
local
discordia
=
Discordia
Module
.
Name
=
"
game
"
Module
.
Global
=
true
function
Module
:
GetConfigTable
()
return
{
{
Array
=
true
,
Global
=
true
,
Name
=
"
GameList
"
,
Description
=
"
List of activities
"
,
Type
=
bot
.
ConfigType
.
String
,
Default
=
{},
Sensitive
=
true
},
}
end
function
Module
:
OnLoaded
()
self
.
UpdateTimer
=
Bot
:
CreateRepeatTimer
(
3
*
60
,
-
1
,
function
()
self
:
UpdateActivity
()
end
)
self
:
UpdateActivity
()
return
true
end
function
Module
:
OnUnload
()
self
.
UpdateTimer
:
Stop
()
end
function
Module
:
UpdateActivity
()
local
games
=
self
.
GlobalConfig
.
GameList
local
newGame
=
games
[
math.random
(
1
,
#
games
)]
if
(
type
(
newGame
)
==
"
function
"
)
then
newGame
=
newGame
()
end
client
:
setActivity
(
newGame
)
end
Back
|
FazBrowse Home
|
New Git URL