wxpy
wxpy copied to clipboard
新人入群@新人的问题
我现在实现的方法是,Note提醒的text里截取了用户呢称,大部分都正常,但是如果用户呢称里有emoji表情,就会错误了。。不知道哪位大神有好办法。。 if msg.type == 'Note': print 'Note notice' print msg.text text=msg.text.split('"')[3] msg.reply(u'{},你好,欢迎加入群'.format(text))
完啦。。我的被封啦,网页版上不去咯。。 :):)
不会吧,真封号了?知道原因吗? 我也在纠结这个,如何欢迎新人进群呢~
# "往事如风<span class="emoji emoji1f44f"></span>"
# 转换为 往事如风👏
def trans_wechat_emoji(s):
def repl(matchobj):
return chr(int('0x1f44f', 16))
r = re.sub(r'<span\s+class="emoji emoji(\w+)"></span>', repl, s)
return r```