-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Revert "Merge branch 'master' of https://github.com/NexInfini…
…te/hivenpy"" This reverts commit 07427a9.
- Loading branch information
1 parent
2d01154
commit 5d385b1
Showing
13 changed files
with
73 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from random import randint | ||
|
||
from Hiven.client import Bot, events | ||
|
||
TOKEN = "[Your token]" | ||
bot = Bot(TOKEN) | ||
|
||
@events.event | ||
def on_ready(): | ||
print(f"Using {bot.user.name}") | ||
|
||
@events.event | ||
def on_message(ctx): | ||
if ctx.author.id != bot.user.id: | ||
if ctx.message == "!roll": | ||
ctx.send(randint(1, 6)) | ||
|
||
bot.login() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
class member_exit_obj: | ||
def __init__(self, ctx): | ||
self.user = self.User(ctx) | ||
self.house_id = ctx['house_id'] | ||
|
||
class User: | ||
def __init__(self, ctx): | ||
self.id = ctx['id'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
class message_update_obj: | ||
def __init__(self, ctx): | ||
self.message = self.Message(ctx) | ||
self.author = self.Author(ctx) | ||
self.room_id = ctx['room_id'] | ||
self.house_id = ctx['house_id'] | ||
|
||
class Message: | ||
def __init__(self, ctx): | ||
self.content = ctx['content'] | ||
self.timestamp = ctx['timestamp'] | ||
self.id = ctx['id'] | ||
self.mentions = ctx['mentions'] | ||
|
||
class Author: | ||
def __init__(self, ctx): | ||
author_json = ctx['author'] | ||
self.username = author_json['username'] | ||
self.name = author_json['name'] | ||
self.id = author_json['id'] | ||
self.iconURL = f"https://media.hiven.io/v1/users/{author_json['id']}/icons/{author_json['icon']}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters