Extend Embed class with set_footer method to set footer for single embed

This commit is contained in:
norohind 2021-08-10 23:17:01 +03:00
parent e834bf9153
commit b621821c4e
Signed by: norohind
GPG Key ID: 01C3BECC26FB59E1

View File

@ -92,6 +92,8 @@ class Embed:
self.add_item(**kwargs)
def add_item(self, **kwargs):
"""Add item to the embed"""
color = kwargs.get('color')
title = kwargs.get('title')
description = kwargs.get('description')
@ -118,9 +120,13 @@ class Embed:
self.items[item][key] = self.items[item][key] + new_value
def set_username(self, username):
"""Will override current webhook username, for reset call this func with None"""
"""Will override current webhook username, for reset, call this func with None"""
self.username = username
def set_footer(self, text, icon_url=None, item=0):
"""Set footer to single embed"""
self.items[item].update(footer=dict(text=text, icon_url=icon_url))
class Messages_sender(threading.Thread):
"""Sending embed message to discord "asynchronously" """