Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Barry
/
discordbot
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
5cf9ae7b
authored
2016-09-09 06:13:39 +0000
by
Barry
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Db Update and bug fixes
1 parent
58ae79f7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
8 deletions
db.sqlite3
hellsbot.py
db.sqlite3
View file @
5cf9ae7
No preview for this file type
hellsbot.py
View file @
5cf9ae7
...
...
@@ -406,7 +406,11 @@ def do_games(client, message_parts, message):
games
=
', '
.
join
(
games_list
)
games
=
games
.
replace
(
"FINAL FANTASY XIV"
,
"**FINAL FANTASY XIV**"
)
log
(
byteify
(
games
))
send_message
(
client
,
message
.
channel
,
'I have seen {} playing: {}'
.
format
(
byteify
(
username
),
byteify
(
games
)))
out_string
=
byteify
(
games
)
while
len
(
out_string
)
>
0
:
send_message
(
client
,
message
.
channel
,
out_string
[:
1900
])
out_string
=
out_string
[
1900
:]
#send_message(client, message.channel, 'I have seen {} playing: {}'.format(byteify(username), byteify(games)))
else
:
send_message
(
client
,
message
.
channel
,
'I don
\'
t have any data on {} yet {}'
.
format
(
byteify
(
username
),
message
.
author
.
mention
()))
...
...
@@ -1452,7 +1456,9 @@ def thread_exception_handler(method, client, message_parts, message):
else
:
globals
()[
method
](
client
)
except
Exception
as
e
:
log
(
"{} - {}"
.
format
(
format_exception
(
e
),
e
.
message
))
error_message
=
"{} - {}"
.
format
(
format_exception
(
e
),
e
.
message
)
message_bot_owner
(
"Exception: {}"
.
format
(
error_message
))
log
(
error_message
)
#################
...
...
@@ -1506,6 +1512,11 @@ def on_message(message):
questions
=
message
.
content
[
len
(
client
.
user
.
name
)
+
1
:]
.
replace
(
'?'
,
''
)
.
split
(
' or '
)
send_message
(
client
,
message
.
channel
,
'{} I choose: {}'
.
format
(
message
.
author
.
mention
(),
random
.
choice
(
questions
)
.
encode
(
'utf-8'
,
errors
=
'ignore'
)))
def
message_bot_owner
(
message
):
for
member
in
client
.
get_all_members
():
if
member
.
id
==
'78767557628133376'
:
send_message
(
client
,
member
,
message
)
break
@client.event
def
on_ready
():
...
...
@@ -1513,12 +1524,7 @@ def on_ready():
log
(
client
.
user
.
name
)
log
(
client
.
user
.
id
)
log
(
'------'
)
for
member
in
client
.
get_all_members
():
if
member
.
id
==
'78767557628133376'
:
send_message
(
client
,
member
,
"Bot Started"
)
break
# for channel in client.get_all_channels():
# client.send_message(member, "Bot Started {} {}".format(channel.id, channel.name))
message_bot_owner
(
"Bot Started."
)
check_msg_queue
(
client
)
...
...
Please
register
or
sign in
to post a comment